if cd /tmp; then echo Worked else echo Failed fiIf you want the script to end when the cd fails
if cd /tmp; then : # This means do nothing on success else echo "Could not change to /tmp" exit 1 fi # Remainder of script
if cd /tmp; then echo Worked else echo Failed fiIf you want the script to end when the cd fails
if cd /tmp; then : # This means do nothing on success else echo "Could not change to /tmp" exit 1 fi # Remainder of script