blob: f339d41f5f76186a650ebb3dc94191791a4cceaa [file] [log] [blame]
Chet Ramey8868eda2020-12-06 15:51:17 -05001# This program is free software: you can redistribute it and/or modify
2# it under the terms of the GNU General Public License as published by
3# the Free Software Foundation, either version 3 of the License, or
4# (at your option) any later version.
5#
6# This program is distributed in the hope that it will be useful,
7# but WITHOUT ANY WARRANTY; without even the implied warranty of
8# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9# GNU General Public License for more details.
10#
11# You should have received a copy of the GNU General Public License
12# along with this program. If not, see <http://www.gnu.org/licenses/>.
13#
Jari Aaltobb706242000-03-17 21:46:59 +000014# tests of return value inversion
15# placeholder for future expansion
16
17# user subshells (...) did this wrong in bash versions before 2.04
18
19! ( echo hello | grep h >/dev/null 2>&1 ); echo $?
20! echo hello | grep h >/dev/null 2>&1 ; echo $?
21
22! true ; echo $?
23! false; echo $?
24
25! (false) ; echo $?
26! (true); echo $?
27
28! true | false ; echo $?
29! false | true ; echo $?
30
31! (true | false) ; echo $?
32! (false | true) ; echo $?