home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!malgudi.oar.net!news.ans.net!cmcl2!panix!fnord
- From: fnord@panix.com (Cliff Heller)
- Subject: Re: Simple Korn shell question
- Message-ID: <1992Dec18.200047.11103@panix.com>
- Date: Fri, 18 Dec 1992 20:00:47 GMT
- References: <Bz9wnp.IHz@cs.uiuc.edu> <15208@hq.hq.af.mil>
- Organization: Right Bleedin' Church of Libertine Obfuscatology
- Lines: 42
-
- In <15208@hq.hq.af.mil> lpeters@postmaster@hq.af.mil (Leslie D Peters) writes:
-
- >In article <Bz9wnp.IHz@cs.uiuc.edu>, schwager@mike.cs.uiuc.edu (Mike Schwager) writes:
- >|> Got a quick one. If I have an alias like this:
- >|>
- >|> alias wow='echo $@ hello there'
- >|>
- >|> or even,
- >|>
- >|> alias wow="echo $@ hello there"
- >|>
- >|> Then why do I get the following when I run the alias? To wit,
- >|>
- >|> $ wt WOW
- >|> hello there WOW
- >|> $
- >|>
- >|> The argument(s) should be first! Why not? The same thing happens with the
- >|> print command.
-
-
- >My experience is that alias uses the parameters it's given at the
- >end. For those actions where *I* need something else, my $HOME/bin
- >directory grows a little bit larger.
-
- The actual fact is that ksh aliases do not accept parameters.
-
- The $@ expands to the parameters that were passed to the shell. (Isn't it
- $* anyway?)
-
- The difference between double and single quoting is when the $@ gets
- expanded, but in both cases it gets expanded to the same thing. The WOW,
- that you stick on the command line just gets added to the command line
- after alias expansion.
-
- If you want to use paramters, you have to define it as a function.
-
- --
- / \ Reverend fnord | "King Kong died for your sins!"
- / \ fnord@panix.com |
- / <0> \ | "Don't just eat a hamburger,
- /_______\ Church of Obfuscatology, Inc. | eat the HELL out of it!"
-