From: lhyatt on
Hello-

I recently got bit by this issue in some of my shell scripts... it
seems that writing to /dev/stdout does not work if you have su'd to a
different user. (This is on debian.) It seems this is because /dev/
stdout is a symlink to /proc/self/fd/1, in turn a symlink to /dev/
pts/..., which only has write permissions for the original logged in
user.

Is this how this is supposed to work? Basically it seems to me that /
dev/stdout is therefore useless inside any shell script, if there is a
chance that someone might want to use it after calling su someday. Is
there a better solution for me? (I can obviously avoid using /dev/
stdout but it's very convenient in some cases). Thanks, and please
advise if this is not the correct group for these kinds of questions.

-Lewis