Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Only shell that doesn't return "shell name".



Hi all,

I was using the following one line script to check out how the
"."(dot) command worked in different shells.

  echo "\$0:  $0"

The file was not executable( -rw-r--r-- ) and to be consistent I always
used the same command.

  . ./<filename>

The shells tested along with output of script:

ash  -- $0:  ash
bash  -- $0:  bash
busybox sh   --  $0:  sh
dash  --  $0:  dash
ksh  --  $0:  ksh
mksh  --  $0:  mksh
sh  --  $0:  sh            My distribution, by default, links sh to bash
sh  --  $0:  sh            With sh linked to zsh
zsh  -- $0:  ./filename

Not that I mind that zsh returns the filename, it is just inconsistent
with all other shells I tested and the way zsh works when emulating sh.
So far searches have not returned any information that tells me if this
should be the normal behaviour.

Q:  Is this the way zsh should behave?

Thanks,

Jim


Messages sorted by: Reverse Date, Date, Thread, Author