I just stumbled over
exec 1> >(logger -s -t $(basename $0)) 2>&1
which is used to redirect the output of the current script to the system logger (in case you've never seen this, but are interested check out https://stackoverflow.com/questions/8888251/understanding-bash-exec-12-command to broaden your shell knowledge).
I am wondering why the 1>
is necessary. It seems necessary because exec >(logger -s -t test) 2>&1
fails due to
bash: /dev/fd/63: Permission denied
bash: exec: /dev/fd/63: cannot execute: Permission denied
Omitting 1>
is however what I'd do intuitively because exec >[some redirection target]
already should be sufficient for the redirection according to the question linked above. 2>&1
then redirects the stderr to stdout as usual.
I'm using bash 4.4.19.
>(...)
means that. I'd accept that as an answer.