Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!zaphod.mps.ohio-state.edu!rpi!crdgw1!sixhub!davidsen From: davidsen@sixhub.UUCP (Wm E. Davidsen Jr) Newsgroups: comp.unix.shell Subject: Re: Finding the last arg Keywords: Bourne shell arguments Message-ID: <2773@sixhub.UUCP> Date: 31 Dec 90 04:16:07 GMT References: <18476@shlump.nac.dec.com> <1990Dec27.154917.14751@virtech.uucp> Reply-To: davidsen@sixhub.UUCP (bill davidsen) Organization: *IX Public Access UNIX, Schenectady NY Lines: 20 In article <1990Dec27.154917.14751@virtech.uucp> cpcahil@virtech.UUCP (Conor P. Cahill) writes: | In article <18476@shlump.nac.dec.com> lan_csse@netrix.nac.dec.com (CSSE LAN Test Account) writes: | >The obvious thing to try is some sort of expression combining $# with ${}, | >e.g. ${$#}. This gets a syntax error. The simpler $$# is valid, but it | | Try: | eval \$$# With sh there is no valid way to do this, it breaks when $# > 9. With ksh the followinf is true: eval echo $# \$## # uses only one digit of $# eval echo $# \${$#} # works for all values Hope that clarifies it. I treid several shells, all flavors of sh seem to stop at $#>9 and need evaluation via shift. -- bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen) sysop *IX BBS and Public Access UNIX moderator of comp.binaries.ibm.pc and 80386 mailing list "Stupidity, like virtue, is its own reward" -me