From: Junio C Hamano <junkio@cox.net>
To: Jason Riedy <ejr@EECS.Berkeley.EDU>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Use printf rather than echo -n.
Date: Tue, 06 Dec 2005 18:04:25 -0800 [thread overview]
Message-ID: <7vfyp5zmqe.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20512.1133907712@lotus.CS.Berkeley.EDU> (Jason Riedy's message of "Tue, 06 Dec 2005 14:21:52 -0800")
Jason Riedy <ejr@EECS.Berkeley.EDU> writes:
> On AIX, there is no -n option to the system's echo. Instead,
> it needs the '\c' control character. We could replace
> echo -n "foo"
> with
> echo -e "foo\c"
> but printf is recommended by most man pages. Tested on AIX
> 5.3, Solaris 8, and Debian.
Hmmmmmmmmmmmmmmmmmmmmmmmm.
Perhaps printf '%s' "$blah" to futureproof, instead of just
saying printf "$blah"?
<rant mode on>
While I do not have anything aginst system without "sane" echo,
I really do not like it. Not your solution, but *having to do*
something like that.
metaconfig Configure does "echo $n frotz $c" with n=-n or c=\\c
set appropriately; autoconf does the same with $ac_n $ac_c.
IIRC, I think ancient autoconf did "echo | tr -d '\012'".
These are far worse than a single printf, although they may be
more portable.
</rant mode off>
As a traditionalist, if I were doing it myself I would probably
pipe echo to tr, but I am lazy so I'd take your patch as is ;-).
next prev parent reply other threads:[~2005-12-07 2:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-06 22:21 [PATCH] Use printf rather than echo -n Jason Riedy
2005-12-07 2:04 ` Junio C Hamano [this message]
2005-12-07 3:31 ` Jason Riedy
-- strict thread matches above, loose matches on Subject: below --
2005-12-08 8:02 linux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vfyp5zmqe.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=ejr@EECS.Berkeley.EDU \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).