zsh-workers
 help / color / mirror / code / Atom feed
* (Fwd) Re: Value of $0
@ 2001-08-06 14:46 Bart Schaefer
  2001-08-06 15:30 ` Oliver Kiddle
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2001-08-06 14:46 UTC (permalink / raw)
  To: zsh-workers

Another way zsh doesn't quite emulate ksh, just FYI.

--- Forwarded mail from David Korn <dgk@research.att.com>

Date: Sun, 5 Aug 2001 23:06:41 -0400 (EDT)
From: David Korn <dgk@research.att.com>
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 <dgk@research.att.com>

-- 
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   


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-08-07 18:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-06 14:46 (Fwd) Re: Value of $0 Bart Schaefer
2001-08-06 15:30 ` Oliver Kiddle
2001-08-07 16:16   ` Bart Schaefer
2001-08-07 17:50     ` Oliver Kiddle
2001-08-07 18:03       ` Bart Schaefer

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).