🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1601

Re: Multiline aliases in csh ?

#1601
From: Larry Wall
Date: Tue, 23 Oct 1990 18:58
26 lines
1332 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.

No, but you can often get the same effect using a program that forces
multiple commands back into your input:

alias patchit forceme "'"'foreach file (*.pat)'"'"\; \
forceme "'"'patch <$file'"'"\; \
forceme 'end'

Won't work in a script, of course, but if you're just interested in being
a lazy typist...

: 	PS.  Right answer is not "use scripts".

Why not?  Assuming a reasonable script language, of course...   :-)

: 	PPS. Would be nice to have functions in csh.

Some would call this "throwing good money after bad".

Larry Wall
lwall@jpl-devvax.jpl.nasa.gov
Technical Details
Message-ID: <10084@jpl-devvax.JPL.NASA.GOV>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!wuarchive!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall
References: <APS.90Oct23053623@kaarne.tut.fi>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!wuarchive!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall
From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall)
Newsgroups: comp.unix.shell
Subject: Re: Multiline aliases in csh ?
Message-ID: <10084@jpl-devvax.JPL.NASA.GOV>
Date: 23 Oct 90 18:58:27 GMT
References: <APS.90Oct23053623@kaarne.tut.fi>
Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall)
Distribution: comp
Organization: Jet Propulsion Laboratory, Pasadena, CA
Lines: 26