blob: 9df8418611ab202a47428e2d4a425190b0d51174 [file] [log] [blame]
Denys Vlasenkoa62bc802016-10-03 00:06:55 +02001echo Default:
2echo "true | true:"
3 true | true; echo $?
4! true | true; echo $?
5echo "true | false:"
6 true | false; echo $?
7! true | false; echo $?
8echo "false | true:"
9 false | true; echo $?
10! false | true; echo $?
11echo "exit 2 | exit 3 | exit 4:"
12 exit 2 | exit 3 | exit 4; echo $?
13! exit 2 | exit 3 | exit 4; echo $?
14
15echo Pipefail on:
16set -o pipefail
17echo "true | true:"
18 true | true; echo $?
19! true | true; echo $?
20echo "true | false:"
21 true | false; echo $?
22! true | false; echo $?
23echo "false | true:"
24 false | true; echo $?
25! false | true; echo $?
26echo "exit 2 | exit 3 | exit 4:"
27 exit 2 | exit 3 | exit 4; echo $?
28! exit 2 | exit 3 | exit 4; echo $?
29
30echo Pipefail off:
31set +o pipefail
32echo "true | true:"
33 true | true; echo $?
34! true | true; echo $?
35echo "true | false:"
36 true | false; echo $?
37! true | false; echo $?
38echo "false | true:"
39 false | true; echo $?
40! false | true; echo $?
41echo "exit 2 | exit 3 | exit 4:"
42 exit 2 | exit 3 | exit 4; echo $?
43! exit 2 | exit 3 | exit 4; echo $?
44
45echo Done