home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!sdd.hp.com!cs.utexas.edu!natinst.com!news.dell.com!texsun!cronkite.Central.Sun.COM!west.West.Sun.COM!male.EBay.Sun.COM!jethro.Corp.Sun.COM!exodus.Eng.Sun.COM!exodus!kuro
- From: kuro@vodka.Eng.Sun.Com (Teruhiko Kurosaka)
- Newsgroups: comp.unix.shell
- Subject: how to get the last pos. parameter in ksh?
- Message-ID: <KURO.92Nov9112643@vodka.Eng.Sun.Com>
- Date: 9 Nov 92 17:26:43 GMT
- Reply-To: kuro@Eng.Sun.Com
- Organization: SunSoft, a Microsystems company, Mt.View, CA, USA
- Lines: 14
- NNTP-Posting-Host: vodka
-
- How can I write a ksh function to examine the last parameter (argument)
- of the command line? I.e., I'd like to know how to access argv[argc-1].
- I tried:
- ${$#}
- but this was interpreted as ${$} yielding the process id of the shell.
- Another try:
- ${@[${@#}]}
- gave me a syntax error.
- -kuro
- --
- -------
- T. Kurosaka ("Kuro") --- SunSoft, a Sun Microsystems company
- Internet:kuro@Eng.Sun.Com Voice:+1 415 336-5284 Fax:+1 415 336-6015
- US Mail: Mail Stop MTV5-44, 2550 Garcia Ave., Mt. View, CA 94043-1100 USA
-