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

Re: protect spaces and/or globs



On Wed, Feb 10, 2021 at 12:54 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> [...] So I assemble my string, save it
> to history (optionally) and then eval it to fire it off.
> [...] But the whole show requires the whole command to
> exist as a string so it can be saved and thus it needs 'eval' to fire it
> off ... unless I'm mistaken.

Following on my last message, it should work fine to do
print -sr -- "${(@q)sarray}"

You probably want (@q-) there, to minimize the number of quoted
things, or (@q+) if you use a lot of unicode characters or control
strings.

Only "print -S" requires a single string argument.




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