From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2755 invoked from network); 6 Aug 2001 14:48:03 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Aug 2001 14:48:03 -0000 Received: (qmail 7196 invoked by alias); 6 Aug 2001 14:47:47 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15576 Received: (qmail 7165 invoked from network); 6 Aug 2001 14:47:43 -0000 From: "Bart Schaefer" Message-Id: <1010806144633.ZM7876@candle.brasslantern.com> Date: Mon, 6 Aug 2001 14:46:33 +0000 X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: (Fwd) Re: Value of $0 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Another way zsh doesn't quite emulate ksh, just FYI. --- Forwarded mail from David Korn Date: Sun, 5 Aug 2001 23:06:41 -0400 (EDT) From: David Korn To: shell@research.att.com Subject: Re: Value of $0 POSIX treats functions as macros so it does not redefine $0. The conform, $0 must remain the name of the shell or script, not the function name. I had to change ksh93 to conform since ksh88 hade $0 be the function name. This is one of the reasons that ksh has stuck with the function name() syntax. These functions have scoping and behave more like shell scripts than macros. $0 is defined as the name of the function for function name() functions. Also, set -x causes each line of a function to be traced with the POSIX shell. Using function name() in ksh93 does not do this and you can set the trace attribute individually for each function using typeset -ft name David Korn research!dgk dgk@research.att.com ____________________________________________________________ To unsubscribe from this list, please send the following two-line message to majordomo@research.att.com, in which your_email_address should be replaced by the address you used when you subscribed to the list: unsubscribe shell your_email_address end ---End of forwarded mail from David Korn -- 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