From: Zach Riggle <zachriggle@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: builtin log supercedes "log" command, only in non-interactive mode
Date: Thu, 11 Nov 2021 00:03:39 -0600 [thread overview]
Message-ID: <CAMP9c5myNRqKtm5g6m20+Dy=nvjaZeH=5YAuGygysWWTrAxRpQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 615 bytes --]
So it seems that "builtin log" takes precedence over commands named "log"
in $path, but only for non-interactive shells.
Is this intentional? It seems unexpected to me, and it was quite hard to
figure out what the root cause was as the error message is not useful
(./myscript:log:5: too many arguments).
I know I can work around this with "command log", I was just surprised that
it works this way.
$ cat what
#!/usr/bin/env zsh
which -a log
$ which -a log
/usr/bin/log
$ zsh ./what
log: shell built-in command
/usr/bin/log
$ zsh -i ./what
/usr/bin/log
*Zach Riggle*
[-- Attachment #2: Type: text/html, Size: 982 bytes --]
next reply other threads:[~2021-11-11 6:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-11 6:03 Zach Riggle [this message]
2021-11-11 6:24 ` Lawrence Velázquez
2021-11-11 6:40 ` Lawrence Velázquez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMP9c5myNRqKtm5g6m20+Dy=nvjaZeH=5YAuGygysWWTrAxRpQ@mail.gmail.com' \
--to=zachriggle@gmail.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).