final solution:

if ! cd "$1"; then echo "error"; exit 1; fi

thank you!

Reply via email to