From: Junio C Hamano Date: Fri, 08 Jun 2012 15:34:55 GMT Subject: Re: rebase [-i --exec | -ix] ... Message-ID: <7vr4tpddgg.fsf@alter.siamese.dyndns.org> In-Reply-To: <4FD1162C.50405@kdbg.org> Johannes Sixt writes: > How about this? > > { > first=t > while read -r insn rest > do > case $insn in > pick) > test -n "$first" || > printf "%s" "$cmd" > ;; > esac > printf "%s %s\n" "$insn" "$rest" > first= > done > printf "%s" "$cmd" > } <"$1" >"$1.new" && > mv "$1.new" "$1" > > together with: > ... This is my favorite version among the ones I've seen so far.