Article View: comp.unix.shell
Article #1543Re: csh args
From: Frank B. Mostek
Date: Fri, 19 Oct 1990 14:51
Date: Fri, 19 Oct 1990 14:51
38 lines
1935 bytes
1935 bytes
pfalstad@phoenix.Princeton.EDU (Paul John Falstad) writes:
>In article <4861@crystal1.UUCP> mostek@motcid.UUCP (Frank B. Mostek) writes:
>>How does one pass several args (more than 2), other than the !^, !*, !$
>>mechanisms, to aliases in csh? I have read the man page, read the UNIX
>>C Shell Field Guide, and "played around" for about an hour.
>I'm not exactly sure what you want to do. Do you know about the !:n syntax?
>% alias first echo \!:1
>% alias second echo \!:2
>% alias swap echo \!:2 \!:1
>% second a b c
>b
>If you have something specific you want, it's probably possible.
>The only way to pass arguments is through this pseudo-history-mechanism
>thing (unless you want all the arguments intact, of course). Very
>kludgy. It's too bad csh doesn't have shell functions.
>--
>Paul Falstad, pfalstad@phoenix.princeton.edu PLink:HYPNOS GEnie:P.FALSTAD
>And Dinsdale said, "You've been a naughty boy, Clement," and splits me nostrils
>open, and saws me leg off, and pulls me liver out. And I said, "My name's not
>Clement." And then he loses his temper. And he nails me head to the floor.
One example is a search alias :
alias sea 'find \!:1 -name "\!:2" -print -exec grep \!:3 {} \;'
Other things I would like to do would be to only "print" the files that grep
finds a pattern in, and pipe the grep into more.
The following alias does not work:
alias sea 'find \!:1 -name "\!:2" -print -exec grep \!:3 {} | more \;'
Technical Details
Message-ID:
<4864@crystal1.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!motcid!mostekReferences:
<4861@crystal1.UUCP> <3448@idunno.Princeton.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!motcid!mostek From: mostek@motcid.UUCP (Frank B. Mostek) Newsgroups: comp.unix.shell Subject: Re: csh args Keywords: csh alias args Message-ID: <4864@crystal1.UUCP> Date: 19 Oct 90 14:51:37 GMT References: <4861@crystal1.UUCP> <3448@idunno.Princeton.EDU> Distribution: comp Organization: Motorola Inc., Cellular Infrastructure Div., Arlington Heights, IL Lines: 38