Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Issue with resolving paths with zsh using \0 in variables
On 06/14/2017 07:02 PM, Bart Schaefer wrote:
> -- probably is a bug, just not the bug you think it is; the error should
> be that "subdir\0" is an illegal file name, rather than terminating the
> path at the nul and botching the redirection.
>
I think it is correct, since \0 is in IFS, word splitting happens since the command substitution
isn't quoted. Since zsh will sent the output of a command to multiple destinations if the result
of an expansion is multiple words, it zsh tries to send the output to dir/ and /myfile; but
fails hard when it can't write to dir/, not attempting to write to /myfile.
When the expansion is quoted, you do get the error that you think it should have.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author