Find the answer to your Linux question:
Results 1 to 2 of 2
I need to suppress the error message when the command is not working. I have given like below, command_name 2> /dev/null But it is not working in Red Hat Linux ...
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    1

    Suppressing Error Message is not working

    I need to suppress the error message when the command is not working. I have given like below,

    command_name 2> /dev/null

    But it is not working in Red Hat Linux release 9. Guide me.


    Thanks in advance

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    It depends upon whether the error message is coming from the application/command itself, or from the shell (such as "command not found"). Redirecting as you did will only redirect command output to stderr. It will not affect any error messages output to stdout or messages from the shell. What exactly are you trying to do, and why?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...