Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
emulate -L sh impact on $0, $argv
- X-seq: zsh-workers 37849
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: emulate -L sh impact on $0, $argv
- Date: Sun, 31 Jan 2016 19:03:40 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=H5FkwsXpSBrbVc8iD+II/GCQc+KKX1KvQaGP8wrXNFE=; b=PtJEQQ8W5g2V+BoAqm+mdgkSL4Pi0V7BvHvQMeAY/gnO8djdFgMAOwMedRel7d/kEc ziYcPkeegEM/IOreT3dhmP8qGg8vNSNIES7VrjjM2X1CnKCHv7thrCnfNWJsKOwIeHY5 boTag6E0JBXsueyF/cj/IuhLgWF6XT5V0WTmaQxujsoWSGLdE3XOP3X4uKz1H25TxRZ2 P7IK5RGpLgSZ/T2mxLAEqVSq49D4FA6DOEORfvcGLjUVwRJzPlbHzVVCaYbkjKIVK/Pa uPjBEh9CzaVqZ37bQ6Hli4LV3qV/GHQykrlwQMqIAhne401BJqhVhaCq4bR9tU45jELD 7ddQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author