Beispiele zum Blogpost.
This commit is contained in:
23
teil25/on-exit.sh
Executable file
23
teil25/on-exit.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#! /usr/bin/bash
|
||||
|
||||
on_exit() {
|
||||
echo "Programmende signalisiert."
|
||||
}
|
||||
|
||||
on_debug() {
|
||||
echo "debug handler"
|
||||
echo "[DEBUG] counter=${counter}"
|
||||
}
|
||||
|
||||
trap on_exit exit
|
||||
trap on_debug debug
|
||||
|
||||
|
||||
sleep 10
|
||||
#counter=0
|
||||
#while true; do
|
||||
# let counter++
|
||||
# echo "running..."
|
||||
#done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user