Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!ucsd!ames!uakari.primate.wisc.edu!ark1!nems!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.unix.questions Subject: Re: /bin/sh Message-ID: <21838@mimsy.umd.edu> Date: 15 Jan 90 23:53:32 GMT References: <620@dr.uucp> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 26 In article <620@dr.uucp> thormod@dr.uucp (Thormod N{ringsrud) writes: >I often have a need to pick up the last parameter $1, $2 .. from >the parameter list. It looks like `eval $"$#"' would do it: $ set foo bar baz $ eval echo $"$#" baz but for a small problem with sh argument syntax: $ set a b c d e f g h i j k l $ echo $11 a1 $ `$11' means `${1}1', and not ${11}. (Trying `${11}' directly gives `bad substitution'.) The only reliable way to get at the last parameter is something like for i do last="$i"; done -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris