From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.mira.net.au (8.6.12/8.6.9) with SMTP id GAA18783 for ; Thu, 15 Jun 1995 06:24:40 +1000 Received: from math (math.skiles.gatech.edu) by gatech.edu with SMTP id AA10878 (5.65c/Gatech-10.0-IDA for ); Wed, 14 Jun 1995 16:25:03 -0400 Received: by math (5.x/SMI-SVR4) id AA02449; Wed, 14 Jun 1995 16:21:35 -0400 Resent-Date: Wed, 14 Jun 1995 16:17:51 -0400 Old-Return-Path: Message-Id: <9506142017.AA13377@grind.icd.teradyne.com> X-Mailer: exmh version 1.6.1 5/23/95 To: zsh-workers@math.gatech.edu Reply-To: acs@world.std.com Subject: Environment Passed to Functions Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 14 Jun 1995 16:17:51 -0400 From: Vinnie Shelton Resent-Message-Id: <"UNLME3.0.7c.EJqtl"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/102 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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