Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: /usr/bin/printf
- X-seq: zsh-users 13829
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: /usr/bin/printf
- Date: Fri, 13 Feb 2009 02:51:30 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=X6prbOH8oDhYbqpA6zYM58mUbaeTWzlQjrvzGq86N98=; b=ucwFHqs4Z4ukBBH4lceyqSl/bGUWGFPnAlcLMcTcIxwCVonl5npn6mpJr7vVoYrgqZ vpImK07CU2hFcKi9D3BKNT+PlKaaFz55IBs2WL7Hagkxc4SIp6X00OlvMtQXppr4SJYl OjuJSNUQaK0wNYT/tGI4/rpIHqyCy7hukNFUU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=JR94wLZ8lwxQ4EF2S6n6OI2mHlqy4uxjkyJQMhv5ihzPhXe7+FLuyd/PFrlJM/ZJnC ipTGtNKNuQZSC3A+8C86eR4SwGD6MBG7H23FH4RgBYLm3EHZ6lqq4Ukc918KSrc2aXF9 disvbTndGxU6/SInGCD6tT0035z81PY42tBRw=
- In-reply-to: <4994CFCF.2090408@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <4994CFCF.2090408@xxxxxxxxxx>
2009/2/13 Matthew Flaschen <matthew.flaschen@xxxxxxxxxx>:
> zsh (zsh 4.3.4 (i686-pc-linux-gnu)) seems to use (probably for
> optimization) its built-in printf even if you explicitly specify
> /usr/bin/printf . Of course, this is only coming up because zsh's
> printf seems to be wrong (or it least doesn't match the executable it's
> mimicking)
>
> Under bash:
>
> $ printf "%s\n" foo
> foo
>
> Under dash (or bash):
>
> $ /usr/bin/printf "%s\n" foo
> foo
>
> Under zsh:
>
> % printf "%s\n" foo
>
> " foofoo
>
> /usr/bin/printf "%s\n" foo
>
> " foofoo
>
> zsh's printf does some really bizarre things:
>
> % /usr/bin/printf "%s" > /dev/null
> " > /dev/null
>
> It actually prints the text /dev/null !
>
> Under bash:
>
> $ /usr/bin/printf "%s" > /dev/null
> $
>
> Is this a known issue?
This is because your preexec() function is broken and is outputting
the newline from the cmdline without escaping it, which makes your
terminal stop reading the title, and the rest of the command line is
just echoed. This is kind of hard to figure out the first time.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author