User Tools

Site Tools


kurs:trap.sh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

kurs:trap.sh [2014/09/10 21:22]
kurs:trap.sh [2014/09/10 21:22] (current)
Line 1: Line 1:
 +<​code>​
 +#!/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
 +</​code>​
  
kurs/trap.sh.txt ยท Last modified: 2014/09/10 21:22 (external edit)