diff --git a/myfunctions.sh b/myfunctions.sh new file mode 100644 index 0000000..6a979b3 --- /dev/null +++ b/myfunctions.sh @@ -0,0 +1,7 @@ +function myerror { + code=$1 + shift + msg="$*" + echo $msg + exit $code +} diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..1c31b42 --- /dev/null +++ b/test.sh @@ -0,0 +1,8 @@ +#! /bin/bash + +set -e +set -u + +source myfunctions.sh + +myerror 42 hello world \ No newline at end of file