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

Re: /usr/bin/printf



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?

Also, it seems that you would more or less always want to make sure to
do this whenever printing anything.

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.



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