On Tue, Nov 11, 2003 at 10:25:31PM +0100, Karsten Merker wrote: > They have no "real" function, in fact they are logically "wrong" here, > but they cause the shell to take an additional redirection which does > not trigger the shell crash that happens without them.
It's not a crash or a segfault or anything like that; the shell is 'set -e' and therefore exits at the first command which returns a non-zero exit status. The old code was certainly wrong, but the new code ought to work, as the shell is not supposed to exit under -e when the command returning non-zero is guarded by an 'if'. It would seem that the shell doesn't handle pipelines in if statements properly under -e. Pending a fix to the shell, I would suggest surrounding the 'if' block with 'set +e' and 'set -e', which ought to fix the problem but makes it more obvious that it's there exactly and only to work around a shell bug. Cheers, -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]