User Tools

Site Tools


kurs:trap.sh
#!/bin/bash

function cleanup {
  echo "werde beendet"
##   exit 1
} 

function hup {
  echo "setze mich zurueck"
  i=1
}

trap hup 1

trap cleanup 2 3 9 15

i=0
while true
do 
  echo $i
  (( i++ ))
  sleep 3
done
kurs/trap.sh.txt · Last modified: 2014/09/10 21:22 (external edit)