home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / shell / 4625 < prev    next >
Encoding:
Text File  |  1992-11-10  |  675 b   |  23 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!caen!sdd.hp.com!hp-col!jimr
  3. From: jimr@col.hp.com (Jim Rogers)
  4. Subject: Re: how to get the last pos. parameter in ksh?
  5. Sender: news@col.hp.com (Usenet News)
  6. Message-ID: <1992Nov10.150853.1975@col.hp.com>
  7. Date: Tue, 10 Nov 1992 15:08:53 GMT
  8. References: <KURO.92Nov9112643@vodka.Eng.Sun.Com>
  9. Organization: HP Colorado Springs Division
  10. Lines: 11
  11.  
  12. kuro@vodka.Eng.Sun.Com (Teruhiko Kurosaka) writes:
  13. > How can I write a ksh function to examine the last parameter (argument)
  14. > of the command line?  I.e., I'd like to know how to access argv[argc-1].
  15.  
  16.  
  17. last=`eval echo \$\{$#\}`
  18. -- 
  19. Jim Rogers
  20. Hewlett-Packard Company
  21.  
  22. jimr@col.hp.com
  23.