From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19479 invoked from network); 28 May 2000 00:31:31 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 May 2000 00:31:31 -0000 Received: (qmail 15284 invoked by alias); 28 May 2000 00:31:17 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11608 Received: (qmail 15277 invoked from network); 28 May 2000 00:31:16 -0000 From: "Bart Schaefer" Message-Id: <1000528003111.ZM22806@candle.brasslantern.com> Date: Sun, 28 May 2000 00:31:10 +0000 X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Positional parameters and sourced files MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Put these commands in /tmp/test.zsh: echo $# $* set a b c d e Now: zsh% source /tmp/test.zsh ; echo $# 0 5 zsh% source /tmp/test.zsh arg ; echo $# 1 arg 0 So "set ..." in a sourced script changes the global positional parameters when the script is called with no arguments, but if it was called with any arguments then it changes only the locals. This seems a bit odd. Bash, on the other hand, always changes the global positional parameters, and further it throws away the local ones when the global ones are set. I don't have ksh handy to try. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net