From: Vinnie Shelton <shelton@grind.ICD.Teradyne.COM>
To: zsh-workers@math.gatech.edu
Subject: Environment Passed to Functions
Date: Wed, 14 Jun 1995 16:17:51 -0400 [thread overview]
Message-ID: <9506142017.AA13377@grind.icd.teradyne.com> (raw)
If an environment variable is set on the command line for a function, then
that enviroment variable is only in effect for the first command in the
function. ksh handles this differently; the variable is in the environment
for all the commands in the function. E.g.
~ Wed 14 16:08 % echo $ZSH_VERSION
2.6-beta9
~ Wed 14 16:12 % echo $LPDEST
~ Wed 14 16:13 % function foo {
> env >/dev/null
> env
> }
~ Wed 14 16:13 % LPDEST=foo foo | grep LPDEST
~ Wed 14 16:14 %
LPDEST is not set. Now for ksh:
~ Wed 14 16:15 % ksh
$ echo $LPDEST
$ function foo {
> env >/dev/null
> env
> }
$ LPDEST=foo foo | grep LPDEST
LPDEST=foo
$
I think the ksh behavior is more useful - it makes a function's environment
more like a shell script's. Opinions?
--Vin
next reply other threads:[~1995-06-14 20:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-06-14 20:17 Vinnie Shelton [this message]
1995-06-15 8:46 ` P.Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9506142017.AA13377@grind.icd.teradyne.com \
--to=shelton@grind.icd.teradyne.com \
--cc=acs@world.std.com \
--cc=zsh-workers@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).