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

Re: Preexec & Printf



On Thu, 25 Apr 2002, Joshua Symons wrote:

> ${(qV)1} appears to be doing the job in 3.1.9, in 3.0.8 (the version
> that comes with solaris 9) or 3.0.6 (the version that comes with solaris
> 8) it gives a syntax error.
> However with ${(QV)1} I still get garbage into my shell.

${(q)...} adds a level of quoting, and ${(Q)...} removes a level.  Per
Geoff's message, the (q) is "working" because it quotes the backslashes
and so forth, protecting e.g. \a from being emitted as control-G by print.

However, what you said you wanted was to remove the quotes, so that's why
I suggested (Q).  That doesn't solve the backslashing problem.

You could try ${(q)${QV)1}} which would first remove the quotes and then
escape the backslashes, or you can stick with just ${(qV)1}.



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