Am I interpreting the man page of ksh incorrectly?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: OpenBSD general usage list <misc@...>
Date: Wednesday, July 2, 2008 - 6:53 am

The ksh man page reads: "The name of the shell (i.e. the contents of
$0) is de-termined as follows: if the -c option is used and there is a
non-option argument, it is used as the name; if commands are being
read from a file, the file is used as the name; otherwise, the
basename the shell was called with (i.e. argv[0]) is used.

The observed behavior is:
[amar@zimbu ~ $] ksh -c "echo $0"
ksh
[amar@zimbu ~ $]

Now, according to the above snippet from the man-page, shouldn't the
output be "echo", and not "ksh"? (echo is the non-option argument, and
-c is also being used). Or am I messing things up in my mind? Thanks
in advance for setting my train of thought straight.

-Amarendra

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Am I interpreting the man page of ksh incorrectly?, Amarendra Godbole, (Wed Jul 2, 6:53 am)
Re: Am I interpreting the man page of ksh incorrectly?, Otto Moerbeek, (Wed Jul 2, 7:44 am)
Re: Am I interpreting the man page of ksh incorrectly?, Raimo Niskanen, (Wed Jul 2, 7:40 am)