zsh-users
 help / color / mirror / code / Atom feed
* Only shell that doesn't return "shell name".
@ 2017-08-21  8:13 Jim
  2017-08-22  1:30 ` Martijn Dekker
  0 siblings, 1 reply; 2+ messages in thread
From: Jim @ 2017-08-21  8:13 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 866 bytes --]

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

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

* Re: Only shell that doesn't return "shell name".
  2017-08-21  8:13 Only shell that doesn't return "shell name" Jim
@ 2017-08-22  1:30 ` Martijn Dekker
  0 siblings, 0 replies; 2+ messages in thread
From: Martijn Dekker @ 2017-08-22  1:30 UTC (permalink / raw)
  To: linuxtechguy, zsh-users

Op 21-08-17 om 10:13 schreef Jim:
[...]> Q:  Is this the way zsh should behave?

Yes. See 'man zshparam' under "Parameters set by the shell", then "0".
Also see 'man zshoptions' under FUNCTION_ARGZERO and POSIX_ARGZERO.

- M.


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

end of thread, other threads:[~2017-08-22  1:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-21  8:13 Only shell that doesn't return "shell name" Jim
2017-08-22  1:30 ` Martijn Dekker

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