🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1582

Re: Multiline aliases in csh ?

#1582
From: Jonathan I. Kamens
Date: Tue, 23 Oct 1990 05:03
29 lines
1405 bytes
In article <APS.90Oct23053623@kaarne.tut.fi>, aps@tut.fi (Suntioinen Ari) writes:
|> 	Is there any way to define multi line alias in csh ?
|> 	What I mean is (for example) if-else or foreach loop 
|> 	as a part of alias. I tried it some time and just 
|> 	couldn't make it work.

  In a word, no.

  There are ways to get around it for if-else, for example checking the
condition for every statement in the if.  If you have this in a shell script:

    if (foo) then
      bar
      baz
    else
      frelt
    endif

Then you can have an alias that does this:

    if (foo) bar; if (foo) baz; if (! foo) frelt

  I don't think there's any way to get around it for foreach.

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik@Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710
Technical Details
Message-ID: <1990Oct23.050332.770@athena.mit.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!bloom-beacon!athena.mit.edu!jik
References: <APS.90Oct23053623@kaarne.tut.fi>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!bloom-beacon!athena.mit.edu!jik
From: jik@athena.mit.edu (Jonathan I. Kamens)
Newsgroups: comp.unix.shell
Subject: Re: Multiline aliases in csh ?
Message-ID: <1990Oct23.050332.770@athena.mit.edu>
Date: 23 Oct 90 05:03:32 GMT
References: <APS.90Oct23053623@kaarne.tut.fi>
Sender: daemon@athena.mit.edu (Mr Background)
Reply-To: jik@athena.mit.edu (Jonathan I. Kamens)
Distribution: comp
Organization: Massachusetts Institute of Technology
Lines: 29