I copied a snippet of Bash to background an ssh command executed remotely:
ssh user@remote <<CMD
some process <&- >log 2>error &
CMD
What does <&- do?
My guess is that it is the same as < /dev/null
My next understanding is that the three main file descriptors (stdin, stdout, stderr) need to be closed to prevent:
- The job being backgrounded and the script exiting -- conflicting somehow?
- When the terminal closes, all processes that are accepting stdin from terminal are closed?