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

Re: [BUG] NO_EXEC should not exec $NULLCMD



> On 06/02/2023 12:22 Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
> Steps to reproduce:
> % PS1='%# ' zsh -f
> % zsh -nc ': $( < $1 )'; print $?
> zsh:1: no such file or directory:
> 1

$(<$1) is special syntax to open $1 and insert it on the command line;
it's nothing to do with $NULLCMD, nor is anything being executed.
So --- given the way NO_EXEC doesn't have a very detailed specification
in zsh --- I don't think it's actually violating any designed behaviour
(that's quite a weak statement in these parts).

However, it is a reasonable question whether the redirection should
be taking place here at all, as it doesn't in other cases when
NO_EXEC is set, even if that's mostly a side effect of where the NO_EXEC
logic lives, so it's certainly quite confusing.   If not, it shouldn't
be hard to suppress.

pws




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