zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: (Fwd) Re: Value of $0
Date: Mon, 6 Aug 2001 14:46:33 +0000	[thread overview]
Message-ID: <1010806144633.ZM7876@candle.brasslantern.com> (raw)

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   


             reply	other threads:[~2001-08-06 14:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-06 14:46 Bart Schaefer [this message]
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

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=1010806144633.ZM7876@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=zsh-workers@sunsite.dk \
    /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).