summaryrefslogtreecommitdiffhomepage
path: root/tests/linux/errors.sh
blob: 29089c592c8e917ebc0c7c70d92b3438fc3e61ae (plain)
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
# Error message format: "script: line N: message".
(echo $((1+))) ; echo "s=$?"
(readonly r; r=1); echo "s=$?"
(set -u; echo $unset_variable); echo "s=$?"
(cd /nonexistent); echo "s=$?"
(exec nonexistent_cmd); echo "s=$?"
(. /nonexistent/file); echo "s=$?"
(shift 3); echo "s=$?"
(break); echo "s=$?"
(return 2>/dev/null); echo "return outside s=$?"
(eval 'if'); echo "s=$?"
(trap 'echo x' BOGUS); echo "s=$?"
(kill -BOGUS $$); echo "s=$?"
(echo x >&9); echo "s=$?"
(echo x >/); echo "s=$?"
(printf '%d\n' abc); echo "s=$?"
(test 1 -eq x); echo "s=$?"
(umask xyz); echo "s=$?"
(: > /dev/full; echo x > /dev/full); echo "write error s=$?"
(set -o bogus); echo "s=$?"
(unset 1bad); echo "s=$?"
(export 1bad=x); echo "s=$?"
(getopts); echo "s=$?"
(wait abc); echo "s=$?"
type echo cd if nonexistent_zz f 2>&1; f() { :; }; type f
command -V echo