Re: [PATCH 2/3] Add a test for git-rerere
- From
Junio C Hamano <junkio@cox.net>
- Date
- Dec 21, 2006, 08:41 UTC
- Message-ID
- <7vhcvpej3i.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.63.0612210927150.19693@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 8 quoted lines
>> > +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.