Computing.Net > Forums > Unix > Supressing error message

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Supressing error message

Reply to Message Icon

Name: moh_hak_786
Date: June 28, 2007 at 01:48:51 Pacific
OS: Unix
CPU/Ram: AIX
Comment:

when I fire 'ls' for file 'moh' which is not present.
getting error message on output
"ls: 0653-341 The file moh does not exist."
how to supress out this message from being displayed when file do not exist



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: June 28, 2007 at 08:52:42 Pacific
Reply:

Unix commands write to either stdout or stderr. You can send stderr to a file

ls 2> errfile moh

or to /dev/null

ls 2> /dev/null moh

Another method is turning stderr off:

ls 2>&- moh


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Supressing error message

Error Message www.computing.net/answers/unix/error-message/7076.html

Unix Error Message Translation www.computing.net/answers/unix/unix-error-message-translation/3056.html

another error message www.computing.net/answers/unix/another-error-message/4940.html