John Buttery wrote:
* x x <pbyrne76@xxxxxxxxxxx> [2002-11-26 13:31:25 +0000]:In 4.0.4 when I issue an 'exec' and zsh can't find the executable it simply terminates without warning. This is surly not desirable behaviour. [snip function to create a "safe" exec] Shouldn't this be builtin?My gut feeling is that zsh's behaviour in this regard is correct, since I always thought there was a core belief (among UNIX software in general, not just zsh) that the software should "do what I say, exactly as I say, and not second-guess me". However, having said that, I think your function is quite useful and that a lot of people will like/use it (possibly myself included). Thanks for taking the time to write it. :)
But zsh doesn't do what the user says and certainly isn't doing what he wants. From a users perspective an exec has two parts: 1. run a new command without forking 2. terminate the shell Since zsh cannot complete the first part it should not try to do the second. More generally if a composite action is composed of several steps, each of which must be completed in order for the composite to be completed, then an exception should be generated if any step fails causing the complete action to fail gracefully. _________________________________________________________________MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus