Recently, I have encountered an error in running a certain imaging processing pipeline on our SGE-based cluster. Running the same pipeline locally not on the HPC cluster was fine. Digging through log files, I found out the error which caused the crash:
/usr/bin/time: /dev/stdout: Not a directory
Looking further, I found the part in the script where in order to capture time command output, standard error was redirected to standard output through /dev/stdout. After further reading, I found that some file systems dont have /dev/stdout.
I edited the script to use 2>&1 instead and it worked fine. However, logging in to the HPC compute node and checking the existence of /dev/stdout, it showed that it exists after all:
# ls /dev/stdout -l
lrwxrwxrwx 1 root root 15 Aug 24 2020 /dev/stdout -> /proc/self/fd/1
uname, lsb_release and bash versions were the same on the local PC and the compute node. Could someone explain the difference in redirecting standard error with 2>&1 and >/dev/stdout, and why my workaround worked?
Thank you!