I can /dev/null the error messages like: <br><br>cd "$1" 2> /dev/null<br><br>e.g.: I get error If "$1" has spaces in it<br><br>Ok, but how can I grep the error message? I tried:<br><br>if cd "$1" 2> grep -i "No such file or directory"; then echo "badbadbad"; exit; fi<br>

<br>But it doesn't work :S<br><br>thank you!<br>