home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / shell / 3941 < prev    next >
Encoding:
Internet Message Format  |  1992-09-14  |  940 b 

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!odin!chet
  2. From: chet@odin.ins.cwru.edu (Chet Ramey)
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: zsh function/positional parameter question...
  5. Date: 14 Sep 1992 14:18:27 GMT
  6. Organization: Case Western Reserve University, Cleveland, OH (USA)
  7. Lines: 20
  8. Distribution: usa
  9. Message-ID: <1926vjINNbf3@usenet.INS.CWRU.Edu>
  10. References: <1992Sep13.022329.21461@beaver.cs.washington.edu>
  11. NNTP-Posting-Host: odin.ins.cwru.edu
  12.  
  13. In article <1992Sep13.022329.21461@beaver.cs.washington.edu> maupin@cs.washington.edu (Ken Maupin) writes:
  14. >following does not work...
  15. >
  16. >    function var () { echo $$1 }
  17.  
  18. Use
  19.  
  20. var()
  21. {
  22.     eval echo \$$1
  23. }
  24.  
  25. This works in bash, at least.
  26.  
  27. Chet
  28. -- 
  29. ``The use of history as therapy means the corruption of history as history.''
  30.     -- Arthur Schlesinger
  31.  
  32. Chet Ramey, Case Western Reserve University    Internet: chet@po.CWRU.Edu
  33.