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

Re: /usr/bin/printf



Nikolai Weibull wrote:
> On Fri, Feb 13, 2009 at 04:25, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> 
>> The problem is that $1 is first expanded by the command parser and then
>> passed to "print".
> 
>> The (q) tells zsh to insert a backslash before any special characters
>> that appear in the value of $1, including the backslash in "\n".  Then
>> "print" strips the extra backslashes off again and the final output is
>> the original string.
> 
> Couldn't one use the -r switch to print as well?

Well, it can't be used for the whole thing, because some escapes are
supposed to be used.  I tested, and:

preexec () { print -Pn "\e]0;%n@%m: "; print -rn "$1"; print -n "\a" }

does works I'm not really sure why there's a \a at the end anyway.  I
presume this doesn't mean system bell here.

Matt Flaschen



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