![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problem redirecting output of command to variable | nunovc | Shell Programming and Scripting | 2 | 08-08-2008 12:15 PM |
| Adding custom mesg. when redirecting "exec 2>stderr.err" ? | snurani | Shell Programming and Scripting | 0 | 07-10-2008 12:19 PM |
| Redirecting STDERR message to STDOUT & file at same time | vikashtulsiyan | Shell Programming and Scripting | 10 | 04-09-2008 02:34 PM |
| Redirecting stderr while live | jjinno | Shell Programming and Scripting | 1 | 10-16-2007 03:10 PM |
| redirecting STDOUT & STDERR | jshinaman | Shell Programming and Scripting | 9 | 06-22-2007 12:04 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Redirecting stderr problem
Code:
% 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. ![]() |
|
||||
|
Sorry but this did't work for me..
Code:
> 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 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.
|
|
||||
|
Thanks ppl for the quick reply.
Sudhamacs, you answered before I got a chance to post the version but here is the information you requested.. Code:
je# uname -srp FreeBSD 6.2-RELEASE i386 je# Another note i should add is that when i hit up (history) i find that the system executes with a space. ls -ld /usr /foo 1>/dev/null/ .. works on they system as .. ls -ld /usr /foo 1 > /dev/null/ ^^Not sure if this is relevant or not. Also, here's some additional information.. Code:
je# ls -l /dev/null crw-rw-rw- 1 root wheel 0, 6 Aug 28 14:35 /dev/null je# ls -l /dev/st* /dev/fd lrwxr-xr-x 1 root wheel 4 Dec 31 1969 /dev/stderr -> fd/2 lrwxr-xr-x 1 root wheel 4 Dec 31 1969 /dev/stdin -> fd/0 lrwxr-xr-x 1 root wheel 4 Dec 31 1969 /dev/stdout -> fd/1 /dev/fd: total 0 crw-rw-rw- 1 root wheel 0, 18 Jul 27 21:37 0 crw-rw-rw- 1 root wheel 0, 20 Jul 27 21:37 1 crw-rw-rw- 1 root wheel 0, 22 Jul 27 21:37 2 je# Last edited by phpfreak; 08-28-2008 at 03:03 PM.. |
|
||||
|
The % prompt is often indicative of csh, what does echo $SHELL say?
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|