home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!cs.utexas.edu!uwm.edu!linac!uchinews!machine!gagme!ddsw1!dattier
- From: dattier@ddsw1.mcs.com (DWT)
- Newsgroups: comp.unix.shell
- Subject: Re: how to get the last pos. parameter in ksh?
- Message-ID: <BxJCEH.75q@ddsw1.mcs.com>
- Date: 11 Nov 92 04:56:39 GMT
- References: <KURO.92Nov9112643@vodka.Eng.Sun.Com>
- Organization: Contributor Account at ddsw1, Chicago, Illinois 60657
- Lines: 17
-
- kuro@Eng.Sun.Com wrote in <KURO.92Nov9112643@vodka.Eng.Sun.Com>:
-
- | 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.
-
- Try
-
- eval \${$#}
-
- David W. Tamkin Box 59297 Northtown Station, Illinois 60659-0297
- dattier@ddsw1.mcs.com CompuServe: 73720,1570 MCI Mail: 426-1818
-