Consider such code:
echo hello >> log.txt echo world >> log.txt
I execute command with stdout redirection. Is it possible to create sticky redirection? Something like this:
redir stdout log.txt echo hello echo world stop-redir
This would be equivalent to the first piece code.
What I really need -- make such sticky redirection for stdout and stderr (at the same time), execute some commands, stop redirection, and read log file.