From: Junio C Hamano Date: Thu, 21 Dec 2006 08:41:53 GMT Subject: Re: [PATCH 2/3] Add a test for git-rerere Message-ID: <7vhcvpej3i.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Johannes Schindelin writes: >> > +rm $rr/postimage >> > +echo -ne "$sha1\ta1\0" > .git/rr-cache/MERGE_RR >> >> Hmmmmmm. I've stayed away from "echo -e" so far... > > Rather do it with tr? Like this: > > echo -n "$sha1 a1X" | tr X '\0' > .git/rr-cache/MERGE_RR Bog-standard old timer's way is not to use -n nor X but just do: echo "stuff you want to NUL terminate" | tr '\012' '\0' > Is $((1+2)) portable enough? I always thought this is a bashism... That's also in ksh and dash (and in POSIX) and recent updates to out *.sh scripts make liberal use of them. As long as you do not overflow you are fine.