aboutsummaryrefslogtreecommitdiffstats
path: root/tests/invert.tests
blob: 8393d95a43fd534716e25cb6a0bba0232029a927 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# tests of return value inversion
# placeholder for future expansion

# user subshells (...) did this wrong in bash versions before 2.04

! ( echo hello | grep h >/dev/null 2>&1 ); echo $?
! echo hello | grep h >/dev/null 2>&1 ; echo $?

! true ; echo $?
! false; echo $?

! (false) ; echo $?
! (true); echo $?

! true | false ; echo $?
! false | true ; echo $?

! (true | false) ; echo $?
! (false | true) ; echo $?