[lug] stderr woes

Ron Wright halsaves at gmail.com
Thu Feb 24 09:02:12 MST 2005


~ $ cat tmp.sh
#!/bin/bash
echo stderr > /dev/stderr
echo stdout > /dev/stdout
echo tty > /dev/tty
~ $ ./tmp.sh
stderr
stdout
tty
~ $ sudo -u nobody ./tmp.sh
./tmp.sh: /dev/stderr: Permission denied
./tmp.sh: /dev/stdout: Permission denied
tty

Ron Wright

On Thu, 24 Feb 2005 09:42:34 -0500, Michael Hirsch <mdhirsch at gmail.com> wrote:
> On Wed, 23 Feb 2005 22:22:34 -0700, Daniel Webb <lists at danielwebb.us> wrote:
> > I'm getting the following output sometimes from a script:
> >
> > /usr/local/bin/ssh-reverse-tunnel: line 63: /dev/stderr: Permission denied
> > /usr/local/bin/ssh-reverse-tunnel: line 63: /dev/stderr: Permission denied
> > /usr/local/bin/ssh-reverse-tunnel: line 63: /dev/stderr: Permission denied
> > /usr/local/bin/ssh-reverse-tunnel: line 63: /dev/stderr: Permission denied
> >
> > Line 63 in the script is (from a function):
> >
> > echo "$THIS: $*" >/dev/stderr
> >
> > If I try:
> >
> > echo "test" >/dev/stderr
> >
> > from the command line as the same user that runs the script, it just
> > prints "test" (to stderr, I assume).
> >
> > Is there some obvious thing I'm overlooking here?
> 
> Strange.  I can't reproduce that with a silly little script.  Can you
> create a smal script that reproduces the problem and post it?
> 
> Michael
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
>



More information about the LUG mailing list