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

Re: /usr/bin/printf



On Feb 13,  4:40am, Nikolai Weibull wrote:
} Subject: Re: /usr/bin/printf
}
} On Fri, Feb 13, 2009 at 04:25, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
} 
} > The (q) tells zsh to insert a backslash before any special characters
} > that appear in the value of $1, including the backslash in "\n".
} 
} Couldn't one use the -r switch to print as well?

One could, except that in this case the strings \e and \a are *meant*
to be expanded by print.  So, you could do *three* prints:

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

} I think it's really unfortunate that print has the same default
} interpretation of its arguments as echo.  It would have been nice if
} there was a command that didn't interpret escapes by default.

Alas, zsh did not invent "print", it copied it from ksh.



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