Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

redirect stderr of echo command

Dude!Jul 4 2011 — edited Jul 4 2011
Hello,

I'm trying to redirect the error output of the echo command. The echo command should redirect output to a file, but not print any errors to stdout in case the file is read-only or any other error occurs.
$ echo text > xxx 2> /dev/null
$ chmod 000 xxx
$ echo text > xxx 2> /dev/null
-bash: xxx: Permission denied
Any ideas?

Thanks!
This post has been answered by Tommy.Reynolds-Oracle on Jul 4 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 1 2011
Added on Jul 4 2011
2 comments
411 views