Skip to content

/dev/stdout: Permission denied

Hi, rescript uses output="/dev/stdout" which causes problems with bash being unable to write to "stdout". To reproduce: I "ssh" to my remote computer, then "su otheruser". Then if you do echo "sth" > /dev/stdout you get an error /dev/stdout: Permission denied. Not sure whether every system is affected with that issue, however I have this problem on many machines with CentOS. Because rescript writes directly to stdout it will throw the same error. It is generally considered a bad practice to write directly to "/dev/stdout" hence I would suggest to replace all occurrences of output="/dev/stdout" in rescript with a code that will not produce this type of error. It will probably also produce an error in every line you where you do backup > $output or similar. I see you also use output="/dev/null" which can be a problem too.

Edited by Pr Pro