2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-05 12:00:16 +00:00
cheat.sheets/sheets/function
2017-06-19 13:46:10 +00:00

16 lines
226 B
Plaintext

# 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"