Zsh Mailing List Archive
Messages sorted by:
- X-seq: zsh-users 13833
- From: Nikolai Weibull <now@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: /usr/bin/printf
- Date: Fri, 13 Feb 2009 04:40:20 +0100
- Cc: zsh-users@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=LpT0peI8T0NheQ+OuBjAJhZs8BpBewcMKL0/U0flMIk=; b=a2qHjvzTvSGXCyKm07ifjB1yMMyj0MPcLwhsQFYJr+VqrOMqLWTbsbSomfs146uCm/ LRiZL3c3KQymsAmzjOrw9LG1qvZX8NKgK/MIOtO6Yn5b0z1EQLtRJEgbaHMYxSlrF0rv HoOwEJzZmd1JX9vE2bYw/5nPNjDTh81vnTXNw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=VZ5arQ8JCOOZlzJotOg0HtCzZ/OD1ci6cHXFH5uTwH0n4Bo9cUSaGrnmFG2Gi4frfB s0ToGgJtEE30UKuaTw+rUBEGxIRg/jakLRkfU2ieWxr7NYqF/0IEPBhk/yZ+YajBq0F/ Fr9vKPoJfA2lfePsZYQNF1fg70uIOBVI4G3Rw=
- In-reply-to: <090212192523.ZM11726@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <4994CFCF.2090408@xxxxxxxxxx> <237967ef0902121751k37dd810co312238682d9b60f0@xxxxxxxxxxxxxx> <4994E32E.2050508@xxxxxxxxxx> <090212192523.ZM11726@xxxxxxxxxxxxxxxxxxxxxx>
- Sender: nikolai.weibull@xxxxxxxxx
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: