- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
#!/bin/bash
export k=1
export g=0
export i=1
export j=1
handle_terminatem() {
let k=-1
let g=0
}
handle_terminatep() {
let k=1
let g=0
}
handle_terminategp() {
let g=1
let k=0
}
handle_terminategm() {
let g=-1
let k=0
}
echo pid $$
trap handle_terminatem 2 3
trap handle_terminatep 20 19 9
trap handle_terminategp 31
trap handle_terminategm 1
while :
do
tput clear
tput cup $i $j
echo "$1 $k $g"
if [ $j -gt 0 ]
then
let "j+=k"
else
let j=1
fi
if [ $i -gt 0 ]
then
let "i+=g"
else
let i=1
fi
sleep 0.1s
done
Комментарии (0) RSS
Добавить комментарий