Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Silent shell but not silent script
- X-seq: zsh-users 9365
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxxxxx>
- Subject: Re: Silent shell but not silent script
- Date: Fri, 02 Sep 2005 15:34:14 +0000
- In-reply-to: <20050902110911.GA158@DervishD>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20050902110911.GA158@DervishD>
On Sep 2, 1:09pm, DervishD 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?
As far as I can tell, it's impossible.
Redirections are done *before* the command execution is attempted,
which is why this ...
} $ ./command 2> /dev/null
... succeeds in suppressing the error message. But that also means
that this ...
} $ { ./command 2>&1 } 2> /dev/null
... does *not* succeed in suppressing the error, it only succeeds in
sending the error to stdout.
} The only solution I've found so far is to pipe stderr thru a sed
} script and get rid of any shell message
I'd have suggested 'grep -v "^zsh:"', or egrep with a more specific
set of messages to suppress.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author