zsh-workers
 help / color / mirror / code / Atom feed
* emulate -L sh impact on $0, $argv
@ 2016-01-31 18:03 Sebastian Gniazdowski
  2016-01-31 18:12 ` Nikolay Aleksandrovich Pavlov (ZyX)
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Gniazdowski @ 2016-01-31 18:03 UTC (permalink / raw)
  To: Zsh hackers list

Hello
Is this expected behavior:

% echo 'echo Hello, my 0 is $0, argv0 is ${argv[0]}' > test_file.sh;
source() { emulate -L zsh; builtin source "$@"; }; source
./test_file.sh
Hello, my 0 is ./test_file.sh, argv0 is

% echo 'echo Hello, my 0 is $0, argv0 is ${argv[0]}' > test_file.sh;
source() { emulate -L sh; builtin source "$@"; }; source
./test_file.sh
Hello, my 0 is source, argv0 is ./test_file.sh

Sometimes -L zsh gives correct argv[0], couldn't clarify exactly when,
it may have something to do with reversed order of the calls.

Best regards,
Sebastian Gniazdowski


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

end of thread, other threads:[~2016-02-07  0:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-31 18:03 emulate -L sh impact on $0, $argv Sebastian Gniazdowski
2016-01-31 18:12 ` Nikolay Aleksandrovich Pavlov (ZyX)
2016-01-31 18:43   ` Bart Schaefer
2016-01-31 19:13   ` Sebastian Gniazdowski
2016-01-31 20:04     ` Nikolay Aleksandrovich Pavlov (ZyX)
2016-01-31 20:37     ` Bart Schaefer
2016-02-07  0:22       ` Daniel Shahaf

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