mirror of
https://github.com/dunwu/linux-tutorial.git
synced 2024-04-15 19:55:24 +08:00
17 lines
229 B
Bash
17 lines
229 B
Bash
#!/usr/bin/env bash
|
|
|
|
# testing signal trapping
|
|
|
|
trap "echo'Sorry! I have trapped Ctrl-C'" SIGINT SIGTERM
|
|
|
|
echo this is a test program
|
|
|
|
count=1
|
|
|
|
while [ $count -le 10 ]
|
|
do
|
|
echo "Loop #$count"
|
|
sleep 5
|
|
count=$[ $count + 1 ]
|
|
done
|