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