Skip to content

Commit 23e2b82

Browse files
committed
trap caller bash trick
1 parent 776add9 commit 23e2b82

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/bash tricks.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ sudo spindump -notarget 60 -o ~/Desktop/spindump.txt
7979
sudo dtrace -q -n 'syscall::exec*:entry { printf("%s %s\n", execname, copyinstr(arg0)); }'
8080
```
8181

82+
# set -euxo pipefail
83+
84+
well.. for set -e at least... https://news.ycombinator.com/item?id=44666984
85+
86+
```sh
87+
trap 'caller 1' ERR
88+
```
89+
90+
also can add -E as of recently.
91+
8292

8393

8494

0 commit comments

Comments
 (0)