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

Re: protect spaces and/or globs



On 2021-02-10 10:08 a.m., Bart Schaefer wrote:
sarray=(grep --color=always -i -- "${grepargs[@]}")
eval "${(@q)sarray}"

Using (@q) causes each individual array element to be quoted
separately.  The double quotes then expand it in the manner of
"${sarray[@]}".

That looks like exactly what I've been wanting.  Test later.





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