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

Re: Saving error return code in a pipeline



    Hi Stephane :)

 * Stephane Chazelas <Stephane@xxxxxxxxxxxxx> dixit:
> > I can use MULTIOS, of course, but I don't want to use it
> > for all my commands...
> > 
> >     Is there any better solution than this?:
> > 
> >     script.install >(tee install.log) 2>&1
> [...]
> zsh has what it calls mult_ios (mult_ios option which is on by
> default) that performs a tee internally when a fd is redirected
> several times.

    Look the paragraph above ;)

> But you can also do:
> script.install |& tee install.log
> script_exit_status=$pipestatus[1]

    Better solution for the script, thanks :)

    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