-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathdebug-options.sh
More file actions
49 lines (49 loc) · 1.38 KB
/
debug-options.sh
File metadata and controls
49 lines (49 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
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
48
49
#!/bin/bash
## debug-options
## version 0.0.1 - initial
##################################################
debug-options() {
#################################################
echo ${FUNCNAME^^}
#################################################
## 1. set -x
## 1. set -v
## 1. set -e
#################################################
## 1. set -x, set -v #
test 0 -eq 0 # were invisible #
echo -n "" # #
set -x -v # wax on #
test 0 -eq 0 # now are visible # + test 0 -eq 0
echo -n "" # # + echo -n ''
set +x +v # wax off # + set +x +y
#################################################
## 1. set -e
set -e
test ! 0 -eq 0 || true # does not echo done
# i.e. exits with status 1
# without || true
test ! 0 -eq 0 || {
# may provide useful debug info here before
# exiting script with exit status as error
false || true # without || true
}
set +e
#################################################
echo done
#################################################
}
##################################################
if [ ${#} -eq 0 ]
then
true
else
exit 1 # wrong args
fi
##################################################
debug-options
##################################################
## generated by create-stub2.sh v0.1.2
## on Mon, 20 May 2019 21:59:34 +0900
## see <https://github.com/temptemp3/sh2>
##################################################