Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: /usr/bin/printf
- X-seq: zsh-users 13836
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: /usr/bin/printf
- Date: Thu, 12 Feb 2009 20:12:34 -0800
- In-reply-to: <dbfc82860902121940x7270f12dt13f10d706c9e65fb@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <4994CFCF.2090408@xxxxxxxxxx> <237967ef0902121751k37dd810co312238682d9b60f0@xxxxxxxxxxxxxx> <4994E32E.2050508@xxxxxxxxxx> <090212192523.ZM11726@xxxxxxxxxxxxxxxxxxxxxx> <dbfc82860902121940x7270f12dt13f10d706c9e65fb@xxxxxxxxxxxxxx>
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