From: Junio C Hamano Date: Fri, 06 Jul 2007 08:33:02 GMT Subject: Re: [PATCH 2/2] filter-branch: fail gracefully when a filter fails Message-ID: <7vir8yextt.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <863b02j6qs.fsf@lola.quinscape.zz> David Kastrup writes: > Instead of "grep ." one could also do something like > > if read line then > while echo "$line" && read line; do :; done > die > fi > > which is fork-less. I'd agree with you that "grep ^" would be preferable _if_ we were to do this. But in your fork-less example, you are assuming that (1) "read" does not molest what is read, (2) "echo" is built-in, and (3) "echo" does not munge the parameter. Since I am one of old fashioned shell people (I readily admit that I used to have _fun_ with autoconf generated shell scripts), I'd love to continue shell skill show-offs, but for the purpose of updating this script, I would say a temporary file is much better than any of the alternatives around 1>&3. For one thing, it would make debugging the script while developing and tweaking it, _and_ while using it, much more pleasant.