Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Silent shell but not silent script



    Hi Mike :)

 * Mike Hernandez <sequethin@xxxxxxxxx> dixit:
> On 9/2/05, DervishD <zsh@xxxxxxxxxxxx> wrote:
> >     Sometimes the command I have to run won't exist, so zsh will
> > issue that error. How the heck can I make zsh not to spill the error
> > message but at the same time let the command to use stderr and
> > stdout? I mean, I can silent zsh doing this:
> Why not test to see if the command exists before doing anything
> with it? Something like if [ -x $command ] ?

    Because that's not enough, I'm afraid. If the command is an
script with a bangpath and the interpreter doesn't exist, the
"[[ -x command ]]" test will succeed but the execution will fail. By
the way, in that case zsh will return 127 instead of the correct 126,
although if I recall correctly, that has been dealt with in latest
CVS :?

    Thanks for your suggestion :) I'm looking for something in that
line, but it's quite difficult. It has to be portable or at least
work in zsh and bash, that will cover nearly 90% of the boxes, and
that's a problem by itself.

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...



Messages sorted by: Reverse Date, Date, Thread, Author