Tugger the SLUGger!SLUG Mailing List Archives

Re: [slug-chat] Script challenge with tee


On Thu, Apr 19, 2001 at 01:59:54 +0000, waratah@xxxxxxxxxx wrote:

> {
>    prog x y z
>    RC=$?
> }  | tee
> 
>   lp ...
> 
> exit $RC
> 
> RC is does not appear to be available to the script.
> 
> Any suggestions?

if you want an ultra-quick-and-dodgey solution, use zsh as the
shell, and do this

    $ zsh
    % prog x y z > filename > /dev/stdout
    % echo $?

(zsh supports redirection to more than one file; it will dupe
 file descriptors etc. as appropriate)

if you don't get a reply by the end of today, i'll forward your
email to the zsh-users list and see if they can suggest a
solution for other shells.


-- 
#ozone/algorithm <ozone@xxxxxxxxxxxxxxxx>          - trust.in.love.to.save