So you have made a nice new script in bash. Fancy you! Alas it has to log to a file and to screen. That might sounds simple, and it is, check this out:
exec > >(tee ${LOGFILE}) 2>&1
WTH? Well just redirect all output (error and out) to a subprocess which tee's it (write to screen and to log).
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment