#!/bin/bash
trap trap_int SIGINT
trap_int() {
echo "Trap int"
}
for i in {1..10}; do echo "$i"; sleep 1; done
Note trap_int is a string that will be evald.
#!/bin/bash
trap trap_int SIGINT
trap_int() {
echo "Trap int"
}
for i in {1..10}; do echo "$i"; sleep 1; done
Note trap_int is a string that will be evald.