linux - set -e overwrites parameter variable($@) in bash script -
i have script test.sh
#/!bin/bash set -e trap errorhandler err errorhandler(){ status=$? trap - err exit $status } echo "$@" exit 0 when call sh test.sh 'hey' print -e instead of hey.
work around surround set -e backticks dont know if still works intended
workaround store in variable in first line set -e in first line 1 obvious reason (handling error).
there clever way this? "hey don't touch $@" command.
got it! -e , –e notice dash. first 1 correct.
lesson learned. not copy code directly html.
Comments
Post a Comment