Q:

Turn off error messages in a bash script

how can one turn off the error messages of a bash script? 
I want to turn it off, and handle the expected ones by myself
For instance, when it does not find some files, to show my specific error message. 
Thanks

A:

You don't want to turn them off - you want to capture them and parse them so you can show your own message. ( Though if the script is well-written, you don't actually have to capture them, just check the exit code.)  You'll need to redirect stderr
script_to_run 2> captured_stderr
# now examine the contents of captured_stderr

If you can do it just with the exit code, you can redirect to /dev/null instead. 
For more about redirection, try the short version or long version here.