Quantcast
Channel: bash: /dev/stderr: Permission denied - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 8

bash: /dev/stderr: Permission denied

$
0
0

After upgrading to a new release version, my bash scripts start spitting errors:

bash: /dev/stderr: Permission denied

in previous versions Bash would internally recognize those file names (which is why this question is not a duplicate of this one) and do the right thing (tm), however, this has stopped working now. What can I do to be able to run my scripts again successfully?

I have tried adding the user running the script to the group tty, but this makes no difference (even after logging out and back in).

I can reproduce this on the command line without problem:

$ echo test > /dev/stdoutbash: /dev/stdout: Permission denied$ echo test > /dev/stderrbash: /dev/stderr: Permission denied$ ls -l /dev/stdout /dev/stderrlrwxrwxrwx 1 root root 15 May 13 02:04 /dev/stderr -> /proc/self/fd/2lrwxrwxrwx 1 root root 15 May 13 02:04 /dev/stdout -> /proc/self/fd/1$ ls -lL /dev/stdout /dev/stderrcrw--w---- 1 username tty 136, 1 May 13 05:01 /dev/stderrcrw--w---- 1 username tty 136, 1 May 13 05:01 /dev/stdout$ echo $BASH_VERSION4.2.24(1)-release

On an older system (Ubuntu 10.04):

$ echo $BASH_VERSION4.1.5(1)-release

Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>