From: Junio C Hamano Date: Wed, 07 Dec 2005 02:04:25 GMT Subject: Re: [PATCH] Use printf rather than echo -n. Message-ID: <7vfyp5zmqe.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20512.1133907712@lotus.CS.Berkeley.EDU> Jason Riedy 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"? 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. 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 ;-).