[ILUG] All args in a script?

kevin lyda kevin at suberic.net
Sat Sep 16 12:41:53 IST 2000


On Sat, Sep 16, 2000 at 10:57:32AM +0000, Conor Daly wrote:
> In a shell script, $# returns the number of arguments to the script.  What
> returns the actual arguments en-masse?  I know $1, $2 returns each in turn
> but I think there's something like $argv that will return all arguments at
> once.

$*

these things are useful on the command line.  for instance in sanity
checking when removing files as root:

ls foo bar* floyd/foozle*
[...listing, check it, and if happy do: ]
rm !*

of course it all goes to hell if you forget to type the ! ...

kevin

-- 
kevin at suberic.net        if you're not part of the solution
fork()'ed on 37058400    you're part of the precipitate.
meatspace place: home    http://suberic.net/~kevin/  yank? www.votenader.com
 >> want privacy? www.gnupg.org or www.pgp.com.  encrypted mail preferred <<




More information about the ILUG mailing list