In bash, how to store stdin and stdout file handle in variable?
I have the following bash script: STDIN=’&0′ if some-condition; then STDIN=some-filename fi run-command <${STDIN} But that errors with &0: No such file or directory. Similarly for STDOUT. I’ve tried using eval but haven’t gotten that to work, either. What needs to be done to get this to work? >Solution : STDIN=’/dev/stdin’ # Default to stdin… Read More In bash, how to store stdin and stdout file handle in variable?