From 1b7956f8b70bb64cb8cc75ba6abd1867afe758fb Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Mon, 19 Jun 2017 13:46:10 +0000 Subject: [PATCH] function --- sheets/function | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sheets/function diff --git a/sheets/function b/sheets/function new file mode 100644 index 0000000..c29fd5d --- /dev/null +++ b/sheets/function @@ -0,0 +1,15 @@ + +# Abort the whole script from a function +# +trap "exit 1" TERM +export TOP_PID=$$ +# +function fatal() +{ + echo "Goodbye" + kill -s TERM $TOP_PID +} +# +echo "Function call will abort" +echo $(func) +echo "This will never be printed"