% ls -ld /usr /foo
ls: /foo: No such file or directory
drwxr-xr-x 14 root wheel 512 May 18 02:49 /usr
% ls -ld /usr /foo 1>/dev/null/
/dev/null/: Not a directory.
% ls -ld /usr /foo 2>/dev/null/
/dev/null/: Not a directory.
^^Why why why doesn't this work for me. Furthermore, where is stdout on the last?
I'm trying to prevent 'find' from barfing the permission denied errors if anybody has experienced that. Wondering if I'm doing something wrong or how to further examine stderr's config on the server.
Side note: Please forgive if this answer is already posted as I've tried searching here and google with no luck. Thanks in advance for your 0.
> ls -ld /usr
drwxr-xr-x 14 root wheel 512 Dec 21 2007 /usr
> ls -ld /usr /foo 2>/dev/null
ls: /foo: No such file or directory
ls: 2: No such file or directory
So again, why is it that redirecting stdout works fine but not stderr? Stdout dosesn't seem to function when stderr fails?
Ls recognizes stdout but not stderr and I'm wondering how is that I can view what stderr is tagged to because to me it's obvious it's not the default '2'. Please help.
Either you are using a csh derivative which doesn't understand the 2> redirection, or you mistyped it. In csh the redirection syntax is different. What happened in the last case was that the regular output was redirected to /dev/null and the error messages were not.