$argv[$#argv]

Tom Manos tmanos at wyvern.uucp
Mon May 27 10:25:31 AEST 1991


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?
>-- 

This works for me:

	#!/bin/sh
	eval echo '$'{$#}

Should work for you, too.
Break out TFM to understand how it works.

Tom
-- 
Tom Manos      Norfolk, VA      tmanos at wyvern       (...!xanth!wyvern!tmanos)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
I gotta get away from this day to day running around.
Everybody knows this is nowhere.  - Neil Young



More information about the Comp.unix.questions mailing list