I want to write code like this:
command=\"some command\" safeRunCommand $command safeRunCommand() { cmnd=$1 $($cmnd) if [ $? != 0 ]
Try
safeRunCommand() { "$@" if [ $? != 0 ]; then printf "Error when executing command: '$1'" exit $ERROR_CODE fi }