summaryrefslogtreecommitdiffstats
path: root/test/bashisms/traps.sh
blob: b357ce7c4c2a7f916f044fc77c197056098daa19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

trap foo ERR # BASHISM
trap foo RETURN # BASHISM
trap foo DEBUG # BASHISM

trap "echo BASHISM" ERR
trap "echo BASHISM" RETURN
trap "echo BASHISM" DEBUG

foo() {
    echo ": dummy function"
}

trap $(foo BASHISM) ERR
trap "$(foo BASHISM)" RETURN
trap "echo $foo BASHISM" DEBUG