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