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

Re: Additional space at end of assignment in preexec's $2 and $3



On Dec 9, 11:51pm, Daniel Hahler wrote:
}
} An assignment appears to have an additional " " at the end of $2 (and
} $3) in preexec:

I believe that's because assignments by themselves are a special-case of
assignment-before-command, as far as the internal wordcode is concerned.

There is no guarantee that the user's input string and the other arguments
passed to preexec will be identical -- in fact, it's explicitly documented
that $2 will have been squashed down to a single line.

Here's a different example of whitespace changing:

torch% foo=bar    :
== preexec ==
+preexec:0> test 'foo=bar    :' '=' 'foo=bar :'
+preexec:0> echo 'foo=bar :'
foo=bar :
+preexec:0> set +x



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