home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / shell / 3930 < prev    next >
Encoding:
Text File  |  1992-09-12  |  1.9 KB  |  40 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!spool.mu.edu!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!uw-beaver!maupin
  3. From: maupin@cs.washington.edu (Ken Maupin)
  4. Subject: zsh function/positional parameter question...
  5. Message-ID: <1992Sep13.022329.21461@beaver.cs.washington.edu>
  6. Sender: news@beaver.cs.washington.edu (USENET News System)
  7. Organization: University of Washington CSE Dept., Seattle, Washington
  8. Distribution: usa
  9. Date: Sun, 13 Sep 92 02:23:29 GMT
  10. Lines: 28
  11.  
  12.     I've been experimenting with zsh (I promise, I haven't
  13. inhaled) and I've run across a slight tangle.  What I want to do in
  14. zsh is accomplished as follows in (t)csh...
  15.  
  16.     alias var 'echo $\!^'
  17.  
  18.     In (t)csh, this alias, when called as 'var name', allows me to
  19. get the value of the variable 'name' without typing 'echo $name'.  In
  20. zsh, a function is required because of the argument -- however, the
  21. following does not work...
  22.  
  23.     function var () { echo $$1 }
  24.  
  25.     This function prints the process id of my login shell (with a
  26. '1' concatenated on the end) instead of the variable value of var's
  27. argument.  No '\!^'-style notation seems to exist in zsh.  I've tried
  28. quoting the dollar signs and enclosing things in parentheses,
  29. brackets, and braces in attempts to separate the dollar signs.  I've
  30. also scoured the zsh man page and intro.txt several times.
  31.     Any suggestions are appreciated.  Please reply via email.
  32. Thanks...
  33.  
  34. \-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-/
  35. |                Kenneth Maupin +===+   o    +===+ "Playing in a band is as   |
  36. |      maupin@cs.washington.edu |   |  /|\   |   |  close as four guys can    |
  37. |      University of Washington |~~~|  Co--= |~~~|  get without having sex."  |
  38. |   Computer Science Department |___|  / \   |___|     -- Dave Mustaine       |
  39. /-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-\
  40.