Bash CD || выход

cd "$foo" || { echo "Error xyz"; exit 1; }
AttractivePenguin