#! /bin/bash # # this script shows an example of using the IF statement to tell if a command # was successful, see the "strings" script and the "integers" script for other # examples of using IF if cd /bin/directory/that/does/not/exist 2> /dev/null then echo "cd was successful" else echo "cd was not successful" fi