Beispiele zum Blogpost.
This commit is contained in:
15
teil25/trap
Executable file
15
teil25/trap
Executable file
@@ -0,0 +1,15 @@
|
||||
#! /usr/bin/bash
|
||||
|
||||
cleanup() {
|
||||
echo "Programmende signalisiert."
|
||||
rm /tmp/testfile
|
||||
}
|
||||
|
||||
trap cleanup exit
|
||||
touch /tmp/testfile
|
||||
|
||||
trap - exit
|
||||
sleep 10
|
||||
echo "Ende der Arbeit"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user