$argv[$#argv]

Doug Gwyn gwyn at smoke.brl.mil
Mon May 27 13:06:01 AEST 1991


In article <1991May25.204543.6428 at midway.uchicago.edu> goer at ellis.uchicago.edu (Richard L. Goerwitz) writes:
>It's not obvious to me how to take the value of the last argv
>element with /bin/sh, the way one can do with the C-Shell using
>subscripts.  Perhaps an ignorant question, but how do?

It's somewhat context sensitive, but here's one example:
	$ set -- a b c
	$ echo `eval echo $"$#"`
	c
	$ 



More information about the Comp.unix.questions mailing list