./prog.sh > prog.log 2>&1

And then, as you mention you could tail -f that file in another terminal.

I haven't played with tee much, I'm sure you could get the ideal setup
with that somehow. Perhaps someone else knows?

-Erik

On Wed, Jan 12, 2011 at 1:07 PM, Josh Trutwin <josh at trutwins.homeip.net> wrote:
> Curious if anyone can help me with this - I have a long running script
> and I'd like to redirect both stdout and stderr to a log file, as well
> as have the output visible on the console (that last part I could live
> without - just run a tail -f after execution).
>
> I've tried both of these after googling around:
>
> ./prog.sh 2>&1 | tee prog.log
> ./prog.sh 3>&1 >&2 2>&3 3>&- | tee prog.log
>
> Neither works - not sure if they aren't supported in /bin/bash.  Any
> suggestions?
>
> Thanks!
>
> Josh
>
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list
>



-- 
Erik K. Mitchell -- Web Developer
erik.mitchell at gmail.com
erik at ekmitchell.com
http://ekmitchell.com/