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

Multios redirection while keeping current descriptors, and exec



Hello all!

Is there a simpler way to additionally log stdout/stderr to a file, while keeping the existing one?

    { echo stdout; >&2 echo stderr } > /tmp/log > /dev/tty 2> /tmp/err 2>/dev/tty

Will log stdout to stdout and /tmp/log, for example.

Specifically, I want to be able to do this for the remainder of the process via "exec".  The goal is to have an interactive stdio like normal, but also log all stdout / stderr to a log file.

Zach Riggle



Messages sorted by: Reverse Date, Date, Thread, Author