blob: 7fcd996409b015780f0d18b32b4e2618c8c8ab73 [file] [log] [blame]
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001t -a noexist
21
3t -a run-all
40
5t -b run-all
61
7t -b /dev/jb1a
81
9t -c run-all
101
11t -c /dev/tty
120
13t -d run-all
141
15t -d /etc
160
Jari Aaltod166f041997-06-05 14:59:13 +000017t -d ""
181
19b -d ""
201
Jari Aaltoccc6cda1996-12-23 17:02:34 +000021t -e noexist
221
23t -e run-all
240
25t -f noexist
261
27t -f /dev/tty
281
29t -f run-all
300
31t -g run-all
321
33t -g /tmp/test.setgid
340
35t -k run-all
361
37t -n ""
381
39t -n "hello"
400
41t -p run-all
421
43t -r noexist
441
45t -r /tmp/test.noread
461
47t -r run-all
480
49t -s noexist
501
51t -s /dev/null
521
53t -s run-all
540
55t -t 20
561
57t -t 0
580
59t -u noexist
601
61t -u run-all
621
63t -u /tmp/test.setuid
640
65t -w noexist
661
67t -w /tmp/test.nowrite
681
69t -w /dev/null
700
71t -x noexist
721
73t -x /tmp/test.exec
740
75t -x /tmp/test.noexec
761
77t -z ""
780
79t -z "foo"
801
81t "foo"
820
83t ""
841
85t -O /tmp/test.owner
860
Jari Aaltocce855b1998-04-17 19:52:44 +000087t -S /tmp/test.socket
881
89t -N /tmp/test.newer
900
Jari Aaltoccc6cda1996-12-23 17:02:34 +000091t "hello" = "hello"
920
93t "hello" = "goodbye"
941
95t "hello" == "hello"
960
97t "hello" == "goodbye"
981
99t "hello" != "hello"
1001
101t "hello" != "goodbye"
1020
103t "hello" < "goodbye"
1041
105t "hello" > "goodbye"
1060
107t ! "hello" > "goodbye"
1081
109t 200 -eq 200
1100
111t 34 -eq 222
1121
Jari Aaltod166f041997-06-05 14:59:13 +0000113t -32 -eq 32
1141
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000115t 200 -ne 200
1161
117t 34 -ne 222
1180
119t 200 -gt 200
1201
121t 340 -gt 222
1220
123t 200 -ge 200
1240
125t 34 -ge 222
1261
127t 200 -lt 200
1281
129t 34 -lt 222
1300
131t 200 -le 200
1320
133t 340 -le 222
1341
135t 700 -le 1000 -a -n "1" -a "20" = "20"
1360
137t ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \)
1381
139t /tmp/abc -nt /tmp/def
1401
141t /tmp/abc -ot /tmp/def
1420
143t /tmp/def -nt /tmp/abc
1440
145t /tmp/def -ot /tmp/abc
1461
147t /tmp/abc -ef /tmp/def
1481
149t /tmp/abc -ef /tmp/ghi
1500
151t -r /dev/fd/0
1520
153t -w /dev/fd/1
1540
155t -w /dev/fd/2
1560
Jari Aaltobb706242000-03-17 21:46:59 +0000157t -r /dev/stdin
1580
159t -w /dev/stdout
1600
161t -w /dev/stderr
1620
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000163t
1641
Jari Aaltod166f041997-06-05 14:59:13 +0000165b
1661
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000167t 12 -eq 34
1681
169t ! 12 -eq 34
1700
171t -n abcd -o aaa
1720
173t -n abcd -o -z aaa
1740
175t -n abcd -a aaa
1760
177t -n abcd -a -z aaa
1781
179t -o allexport
1801
181t ! -o allexport
1820
Chet Ramey495aee42011-11-22 19:11:26 -0500183t -v unset
1841
185t -v set
1860
187t -v set
1880
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000189t xx -a yy
1900
191t xx -o ""
1920
193t xx -a ""
1941
195t -X -a -X
1960
197t -X -o -X
1980
199t -X -o ""
2000
201t -X -a ""
2021
203t "" -a -X
2041
205t "" -o -X
2060
207t "" -a ""
2081
209t "" -o ""
2101
211t true -o -X
2120
213t true -a -X
2140
215t ( -E )
2160
217t ( "" )
2181
Jari Aaltod166f041997-06-05 14:59:13 +0000219t ! -z "$z"
2200
221t ! -n "$z"
2221
223t "$zero"
2241
225t ! "$zero"
2260
227b "$zero"
2281
229b ! "$zero"
2300
231t -G /tmp/test.group
2320
233t -h /tmp/test.symlink
2340
235t 4+3 -eq 7
Jari Aalto7117c2d2002-07-17 14:10:11 +0000236./test.tests: line 13: test: 4+3: integer expression expected
Jari Aaltob72432f1999-02-19 17:11:39 +00002372
Jari Aaltod166f041997-06-05 14:59:13 +0000238b 4-5 -eq 7
Jari Aalto7117c2d2002-07-17 14:10:11 +0000239./test.tests: line 7: [: 4+3: integer expression expected
Jari Aaltob72432f1999-02-19 17:11:39 +00002402
Jari Aaltod166f041997-06-05 14:59:13 +0000241t 9 -eq 4+5
Jari Aalto7117c2d2002-07-17 14:10:11 +0000242./test.tests: line 13: test: 4+5: integer expression expected
Jari Aaltob72432f1999-02-19 17:11:39 +00002432
Jari Aaltod166f041997-06-05 14:59:13 +0000244b 9 -eq 4+5
Jari Aalto7117c2d2002-07-17 14:10:11 +0000245./test.tests: line 7: [: 4+5: integer expression expected
Jari Aaltob72432f1999-02-19 17:11:39 +00002462
Jari Aaltod166f041997-06-05 14:59:13 +0000247t A -eq 7
Jari Aalto7117c2d2002-07-17 14:10:11 +0000248./test.tests: line 13: test: A: integer expression expected
Jari Aaltob72432f1999-02-19 17:11:39 +00002492
Jari Aaltod166f041997-06-05 14:59:13 +0000250b A -eq 7
Jari Aalto7117c2d2002-07-17 14:10:11 +0000251./test.tests: line 7: [: A: integer expression expected
Jari Aaltob72432f1999-02-19 17:11:39 +00002522
Jari Aaltod166f041997-06-05 14:59:13 +0000253t 9 -eq B
Jari Aalto7117c2d2002-07-17 14:10:11 +0000254./test.tests: line 13: test: B: integer expression expected
Jari Aaltob72432f1999-02-19 17:11:39 +00002552
Jari Aaltod166f041997-06-05 14:59:13 +0000256b 9 -eq B
Jari Aalto7117c2d2002-07-17 14:10:11 +0000257./test.tests: line 7: [: B: integer expression expected
Jari Aaltob72432f1999-02-19 17:11:39 +00002582
Jari Aaltod166f041997-06-05 14:59:13 +0000259t ( 1 = 2
Jari Aalto7117c2d2002-07-17 14:10:11 +0000260./test.tests: line 13: test: `)' expected
Jari Aaltob72432f1999-02-19 17:11:39 +00002612
Jari Aaltod166f041997-06-05 14:59:13 +0000262b ( 1 = 2
Jari Aalto7117c2d2002-07-17 14:10:11 +0000263./test.tests: line 7: [: `)' expected, found ]
Jari Aaltob72432f1999-02-19 17:11:39 +00002642
Jari Aalto7117c2d2002-07-17 14:10:11 +0000265./test.tests: line 13: test: a: unary operator expected
Jari Aaltob72432f1999-02-19 17:11:39 +00002662
Jari Aalto7117c2d2002-07-17 14:10:11 +0000267./test.tests: line 13: test: b: binary operator expected
Jari Aaltob72432f1999-02-19 17:11:39 +00002682
Jari Aalto7117c2d2002-07-17 14:10:11 +0000269./test.tests: line 13: test: -A: unary operator expected
Jari Aaltob72432f1999-02-19 17:11:39 +00002702
Jari Aalto7117c2d2002-07-17 14:10:11 +0000271./test.tests: line 13: test: too many arguments
Jari Aaltob72432f1999-02-19 17:11:39 +00002722
Jari Aalto7117c2d2002-07-17 14:10:11 +0000273./test.tests: line 13: test: too many arguments
Jari Aaltob72432f1999-02-19 17:11:39 +00002742
Chet Ramey495aee42011-11-22 19:11:26 -0500275./test.tests: line 418: [: missing `]'
Jari Aaltob72432f1999-02-19 17:11:39 +00002762
Jari Aalto7117c2d2002-07-17 14:10:11 +0000277./test.tests: line 13: test: (: unary operator expected
Jari Aaltob72432f1999-02-19 17:11:39 +00002782
Jari Aalto28ef6c32001-04-06 19:14:31 +0000279t -t a
2801
281t -t addsds
2821
283t -t 42
2841
285t -t /dev/tty
2861
287t -t /dev/tty4
2881
289t -t /dev/tty4444444...
2901
Jari Aalto31859422009-01-12 13:36:28 +00002911