summaryrefslogtreecommitdiffstats
path: root/runtime/poky/qemuarm64/core-image-ptest-busybox/ptest-busybox.log
blob: a25c789bf7e1c5c3ed50ac2358d7ad909542d39b (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
START: ptest-runner
2024-04-18T01:20
======================
echo -ne '' >input
echo -ne '' | ./unknown 2>&1
PASS: busybox as unknown name
SKIP: busybox --help busybox
======================
echo -ne '' >input
echo -ne '' | busybox 2>&1 | cat
PASS: busybox
======================
echo -ne '' >input
echo -ne '' | busybox unknown 2>&1
PASS: busybox unknown
======================
echo -ne '' >input
echo -ne '' | busybox --help 2>&1
PASS: busybox --help
SKIP: busybox cat
SKIP: busybox --help cat
======================
echo -ne '' >input
echo -ne '' | busybox --help unknown 2>&1
PASS: busybox --help unknown
======================
echo -ne '' >input
echo -ne '' | ./busybox-suffix 2>&1 | cat
PASS: ./busybox-suffix
======================
echo -ne '' >input
echo -ne '' | ./busybox-suffix unknown 2>&1
PASS: ./busybox-suffix unknown
======================
echo -ne '' >input
echo -ne '' | ./busybox-suffix --help 2>&1
PASS: ./busybox-suffix --help
SKIP: ./busybox-suffix cat
SKIP: ./busybox-suffix --help cat
======================
echo -ne '' >input
echo -ne '' | ./busybox-suffix --help unknown 2>&1
PASS: ./busybox-suffix --help unknown
======================
echo -ne '' >input
echo -ne '' | awk -F '[#]' '{ print NF }'
PASS: awk -F case 0
======================
echo -ne '' >input
echo -ne '\n' | awk -F '[#]' '{ print NF }'
PASS: awk -F case 1
======================
echo -ne '' >input
echo -ne '#\n' | awk -F '[#]' '{ print NF }'
PASS: awk -F case 2
======================
echo -ne '' >input
echo -ne '#abc#\n' | awk -F '[#]' '{ print NF }'
PASS: awk -F case 3
======================
echo -ne '' >input
echo -ne '#abc#zz\n' | awk -F '[#]' '{ print NF }'
PASS: awk -F case 4
======================
echo -ne '' >input
echo -ne '#abc##zz\n' | awk -F '[#]' '{ print NF }'
PASS: awk -F case 5
======================
echo -ne '' >input
echo -ne 'z#abc##zz\n' | awk -F '[#]' '{ print NF }'
PASS: awk -F case 6
======================
echo -ne '' >input
echo -ne 'z##abc##zz\n' | awk -F '[#]' '{ print NF }'
PASS: awk -F case 7
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN{if(23==23) print "foo"}'
PASS: awk if operator == 
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN{if(23!=23) print "bar"}'
PASS: awk if operator != 
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN{if(23>=23) print "foo"}'
PASS: awk if operator >= 
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN{if(2 < 13) print "foo"}'
PASS: awk if operator < 
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN{if("a"=="ab") print "bar"}'
PASS: awk if string == 
======================
echo -ne '' >input
echo -ne '\n' | awk '{ print or(4294967295,1) }'
PASS: awk bitwise op
======================
echo -ne '' >input
echo -ne '' | awk '
function empty_fun(count) {
  # empty
}
END {
  i=1
  print "L" i "\n"
  empty_fun(i + i + ++i)
  print "L" i "\n"
}'
PASS: awk handles empty function f(arg){}
======================
echo -ne '' >input
echo -ne '' | awk '
function empty_fun(){}
END {empty_fun()
  print "Ok"
}'
PASS: awk handles empty function f(){}
======================
echo -ne '' >input
echo -ne '' | awk '
function outer_fun() {
  return 1
}
END {
  i=1
  print "L" i "\n"
  i += outer_fun()
  print "L" i "\n"
}'
PASS: awk properly handles function from other scope
======================
echo -ne '' >input
echo -ne '' | awk '
END {
  i=1
  print "L" i "\n"
  i + trigger_error_fun()
  print "L" i "\n"
}' 2>&1
PASS: awk properly handles undefined function
======================
echo -ne '' >input
echo -ne '' | awk '
BEGIN {
  v=1
  a=2
  print v (a)
}' 2>&1
PASS: awk 'v (a)' is not a function call, it is a concatenation
======================
echo -ne '' >input
echo -ne '' | awk 'func f(){print"F"};func g(){print"G"};BEGIN{f(g(),g())}' 2>&1
PASS: awk unused function args are evaluated
SKIP: awk hex const 1
SKIP: awk hex const 2
SKIP: awk oct const
======================
echo -ne '' >input
echo -ne '011\n' | awk '{ print $1, $1+1 }'
PASS: awk input is never oct
======================
echo -ne '' >input
echo -ne '\n' | awk '{ printf "%f %f\n", "000.123", "009.123" }'
PASS: awk floating const with leading zeroes
======================
echo -ne '' >input
echo -ne 'a--\na--b--\na--b--c--\na--b--c--d--' | awk -F-- '{ print NF, length($NF), $NF }'
PASS: awk long field sep
======================
echo -ne '' >input
echo -ne 'a!b\n' | awk -F'\x21' '{print $1}'
PASS: awk -F handles escapes
======================
echo -ne '' >input
echo -ne 'Hi\n' | awk 'gsub("@(samp|code|file)\{","");'; echo $?
PASS: awk gsub falls back to non-extended-regex
======================
echo -ne '' >input
echo -ne '' | awk -f awk_t1_opt-functions.awk -f awk_t1_opth-gen.awk <awk_t1_input | md5sum
PASS: awk 'gcc build bug'
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN { print ":" NF ":" $0 ":" $1 ":" $2 ":" }'
PASS: awk NF in BEGIN
======================
echo -ne '' >input
echo -ne '' | awk '
function b(tmp) {
	tmp = 0;
	print "" tmp; #this line causes the bug
	return tmp;
}
function c(tmpc) {
	tmpc = b(); return tmpc;
}
BEGIN {
	print (c() ? "string" : "number");
}'
PASS: awk string cast (bug 725)
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN { arr [3] = 1; print arr [3] }'
PASS: awk handles whitespace before array subscript
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN { getline line <"doesnt_exist"; print ERRNO; ERRNO=0; close("doesnt_exist"); print ERRNO; print "Ok" }'
PASS: awk handles non-existing file correctly
======================
echo -ne '' >input
echo -ne '' | awk '
BEGIN {
  u["a"]=1
  u["b"]=1
  u["c"]=1
  v["d"]=1
  v["e"]=1
  v["f"]=1
  for (l in u) {
    print "outer1", l;
    for (l in v) {
      print " inner", l;
    }
    print "outer2", l;
  }
  print "end", l;
  l="a"
  exit;
}'
PASS: awk nested loops with the same variable
======================
echo -ne '' >input
echo -ne '' | awk '
BEGIN{
cnt = 0
a[cnt] = "zeroth"
a[++cnt] = "first"
delete a[cnt--]
print cnt
print "[0]:" a[0]
print "[1]:" a[1]
}'
PASS: awk 'delete a[v--]' evaluates v-- once
======================
echo -ne '' >input
echo -ne '' | awk 'func f(,) { }' 2>&1
PASS: awk func arg parsing 1
======================
echo -ne '' >input
echo -ne '' | awk 'func f(a,,b) { }' 2>&1
PASS: awk func arg parsing 2
======================
echo -ne '' >input
echo -ne '' | awk 'func f(a,) { }' 2>&1
PASS: awk func arg parsing 3
======================
echo -ne '' >input
echo -ne '' | awk 'func f(a b) { }' 2>&1
PASS: awk func arg parsing 4
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN {print()}' 2>&1
PASS: awk handles empty ()
======================
echo -ne '' >input
echo -ne 'a:b c:d\ne:f g:h' | awk '{FS=":"; print $1}'
PASS: awk FS assignment
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN{n=(2^31)-1; print n, int(n), n%1, ++n, int(n), n%1}'
PASS: awk large integer
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN{ A[1]=2; A["qwe"]="asd"; print length(A)}'
PASS: awk length(array)
======================
echo -ne '' >input
echo -ne 'qwe' | awk '{print length; print length(); print length("qwe"); print length(99+9)}'
PASS: awk length()
======================
echo -ne '' >input
echo -ne '\n' | awk '{ print length, 1 }'
PASS: awk print length, 1
======================
echo -ne '' >input
echo -ne '\n' | awk '{ print length 1 }'
PASS: awk print length 1
======================
echo -ne '' >input
echo -ne '\n' | awk 'length == 0 { print "foo" }'
PASS: awk length == 0
======================
echo -ne '' >input
echo -ne '\n' | awk '{ if (length == 0) { print "bar" } }'
PASS: awk if (length == 0)
======================
echo -ne 'do re mi\n' >input
echo -ne '{print $2; print ARGC;}' | awk -f - input
PASS: awk -f and ARGC
======================
echo -ne 'do re mi\n' >input
echo -ne '' | awk -e '{print $2; print ARGC;}' input
PASS: awk -e and ARGC
======================
echo -ne '' >input
echo -ne 'BEGIN { if (1) break; else a = 1 }' | awk -f - 2>&1; echo $?
PASS: awk break
======================
echo -ne '' >input
echo -ne 'BEGIN { if (1) continue; else a = 1 }' | awk -f - 2>&1; echo $?
PASS: awk continue
======================
echo -ne '' >input
echo -ne '' | awk -e '{ for() }' 2>&1
PASS: awk handles invalid for loop
======================
echo -ne '' >input
echo -ne '' | awk -e foo:bar: 2>&1
PASS: awk handles colon not preceded by ternary
======================
echo -ne '' >input
echo -ne '' | awk -e '{delete}' 2>&1
PASS: awk errors on missing delete arg
======================
echo -ne '' >input
echo -ne '\n' | awk '{printf("hello%c null\n", 0)}'
PASS: awk printf('%c') can output NUL
SKIP: awk printf('%-10c') can output NUL
======================
echo -ne '' >input
echo -ne 'anything' | awk 2>&1 -- '{ $(-1) }'
PASS: awk negative field access
======================
echo -ne '' >input
echo -ne 'anything' | awk -v i=1 "BEGIN {print \"str\" ++i}"
PASS: awk do not allow "str"++
======================
echo -ne '' >input
echo -ne 'foo--bar' | awk -F '-*' '{print $1 "-" $2 "=" $3 "*" $4}'
PASS: awk FS regex which can match empty string
======================
echo -ne '' >input
echo -ne 'a=====123=' | awk -F '=+' '{print $NF}'
PASS: awk $NF is empty
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN { exit 42 } END { exit }'; echo $?
PASS: awk exit N propagates through END's exit
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN { print "STDERR %s" >"/dev/stderr" }' 2>&1
PASS: awk print + redirect
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN { "echo HELLO" | getline; print }'
PASS: awk "cmd" | getline
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN { printf "%%\n" }'
PASS: awk printf %% prints one %
======================
echo -ne '' >input
echo -ne '' | awk 'BEGIN { printf "Hello\
 world\n" }'
PASS: awk backslash+newline eaten with no trace
======================
echo -ne '' >input
echo -ne 'foo' | awk '$1==$1="foo" {print $1}'
PASS: awk assign while test
PASS: basename-does-not-remove-identical-extension
PASS: basename-works
PASS: bunzip2-reads-from-standard-input
PASS: bunzip2-removes-compressed-file
PASS: bunzip2: doesnt exist
PASS: bunzip2: unknown suffix
PASS: bunzip2: already exists
PASS: bunzip2: stream unpack
PASS: bunzip2: delete src
PASS: bunzip2: test_bz2 file
PASS: bunzip2: pbzip_4m_zeros file
PASS: bunzip2: bz2_issue_11.bz2 corrupted example
PASS: bunzip2: bz2_issue_12.bz2 corrupted example
PASS: bzcat-does-not-remove-compressed-file
PASS: zcat: dont delete gz src
PASS: zcat: dont delete bz2 src
PASS: zcat: dont delete Z src
======================
echo -ne '\x42\x5a\x68\x39\x31\x41\x59\x26\x53\x59\x63\x3e\xd6\xe2\x00\x00\x00\xc1\x00\x00\x10\x20\x00\x20\x00\x21\x00\x82\xb1\x77\x24\x53\x85\x09\x06\x33\xed\x6e\x20' >input
echo -ne '' | bzcat input input; echo $?
PASS: bzcat can print many files
======================
echo -ne '\x42\x5a\x68\x39\x17\x72\x45\x38\x50\x90\x00\x00\x00\x00' >input
echo -ne '' | bzcat input input; echo $?
PASS: bzcat can handle compressed zero-length bzip2 files
======================
echo -ne '\x1f\x9d\x90\x61\x14\x00' >input
echo -ne '' | zcat input input; echo $?
PASS: zcat can print many files
======================
echo -ne '\x1f\x9d\x90\x00' >input
echo -ne '' | zcat input input; echo $?
PASS: zcat can handle compressed zero-length (.Z) files
PASS: cat-prints-a-file
PASS: cat-prints-a-file-and-standard-input
SKIP: cat -e
SKIP: cat -v
======================
echo -ne '' >input
echo -ne 'line 1\n\nline 3\n' | cat -n
PASS: cat -n
======================
echo -ne '' >input
echo -ne 'line 1\n\nline 3\n' | cat -b
PASS: cat -b
PASS: cmp-detects-difference
PASS: cp-RHL-does_not_preserve-links
PASS: cp-a-files-to-dir
PASS: cp-a-preserves-links
PASS: cp-copies-empty-file
PASS: cp-copies-large-file
PASS: cp-copies-small-file
PASS: cp-d-files-to-dir
PASS: cp-dev-file
PASS: cp-dir-create-dir
PASS: cp-dir-existing-dir
PASS: cp-does-not-copy-unreadable-file
PASS: cp-files-to-dir
PASS: cp-follows-links
PASS: cp-parents
SKIP: cp-preserves-hard-links
PASS: cp-preserves-links
PASS: cp-preserves-source-file
======================
echo -ne '' >input
echo -ne '' | \
cd cp.testdir || exit 1; cp * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
test ! -L file         && test   -f file             || echo BAD: file
test ! -L file_symlink && test   -f file_symlink     || echo BAD: file_symlink
test ! -L dir          && test ! -e dir              || echo BAD: dir
test ! -L dir_symlink  && test ! -e dir_symlink      || echo BAD: dir_symlink

PASS: cp
======================
echo -ne '' >input
echo -ne '' | \
cd cp.testdir || exit 1; cp -d * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
test ! -L file         && test   -f file             || echo BAD: file
test   -L file_symlink && test   -f file_symlink     || echo BAD: file_symlink
test ! -L dir          && test ! -e dir              || echo BAD: dir
test   -L dir_symlink  && test ! -e dir_symlink      || echo BAD: dir_symlink

PASS: cp -d
======================
echo -ne '' >input
echo -ne '' | \
cd cp.testdir || exit 1; cp -P * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
test ! -L file         && test   -f file             || echo BAD: file
test   -L file_symlink && test   -f file_symlink     || echo BAD: file_symlink
test ! -L dir          && test ! -e dir              || echo BAD: dir
test   -L dir_symlink  && test ! -e dir_symlink      || echo BAD: dir_symlink

PASS: cp -P
======================
echo -ne '' >input
echo -ne '' | \
cd cp.testdir || exit 1; cp -L * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
test ! -L file         && test   -f file             || echo BAD: file
test ! -L file_symlink && test   -f file_symlink     || echo BAD: file_symlink
test ! -L dir          && test ! -e dir              || echo BAD: dir
test ! -L dir_symlink  && test ! -e dir_symlink      || echo BAD: dir_symlink

PASS: cp -L
======================
echo -ne '' >input
echo -ne '' | \
cd cp.testdir || exit 1; cp -H * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
test ! -L file         && test   -f file             || echo BAD: file
test ! -L file_symlink && test   -f file_symlink     || echo BAD: file_symlink
test ! -L dir          && test ! -e dir              || echo BAD: dir
test ! -L dir_symlink  && test ! -e dir_symlink      || echo BAD: dir_symlink

PASS: cp -H
======================
echo -ne '' >input
echo -ne '' | \
cd cp.testdir || exit 1; cp -R * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
test ! -L file             && test   -f file             || echo BAD: file
test   -L file_symlink     && test   -f file_symlink     || echo BAD: file_symlink
test ! -L dir              && test   -d dir              || echo BAD: dir
test   -L dir_symlink      && test   -d dir_symlink      || echo BAD: dir_symlink
test ! -L dir/file         && test   -f dir/file         || echo BAD: dir/file
test   -L dir/file_symlink && test   -f dir/file_symlink || echo BAD: dir/file_symlink

PASS: cp -R
======================
echo -ne '' >input
echo -ne '' | \
cd cp.testdir || exit 1; cp -Rd * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
test ! -L file             && test   -f file             || echo BAD: file
test   -L file_symlink     && test   -f file_symlink     || echo BAD: file_symlink
test ! -L dir              && test   -d dir              || echo BAD: dir
test   -L dir_symlink      && test   -d dir_symlink      || echo BAD: dir_symlink
test ! -L dir/file         && test   -f dir/file         || echo BAD: dir/file
test   -L dir/file_symlink && test   -f dir/file_symlink || echo BAD: dir/file_symlink

PASS: cp -Rd
======================
echo -ne '' >input
echo -ne '' | \
cd cp.testdir || exit 1; cp -RP * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
test ! -L file             && test   -f file             || echo BAD: file
test   -L file_symlink     && test   -f file_symlink     || echo BAD: file_symlink
test ! -L dir              && test   -d dir              || echo BAD: dir
test   -L dir_symlink      && test   -d dir_symlink      || echo BAD: dir_symlink
test ! -L dir/file         && test   -f dir/file         || echo BAD: dir/file
test   -L dir/file_symlink && test   -f dir/file_symlink || echo BAD: dir/file_symlink

PASS: cp -RP
======================
echo -ne '' >input
echo -ne '' | \
cd cp.testdir || exit 1; cp -RL * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
test ! -L file             && test   -f file             || echo BAD: file
test ! -L file_symlink     && test   -f file_symlink     || echo BAD: file_symlink
test ! -L dir              && test   -d dir              || echo BAD: dir
test ! -L dir_symlink      && test   -d dir_symlink      || echo BAD: dir_symlink
test ! -L dir/file         && test   -f dir/file         || echo BAD: dir/file
test ! -L dir/file_symlink && test   -f dir/file_symlink || echo BAD: dir/file_symlink

PASS: cp -RL
======================
echo -ne '' >input
echo -ne '' | \
cd cp.testdir || exit 1; cp -RHL * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
test ! -L file             && test   -f file             || echo BAD: file
test ! -L file_symlink     && test   -f file_symlink     || echo BAD: file_symlink
test ! -L dir              && test   -d dir              || echo BAD: dir
test ! -L dir_symlink      && test   -d dir_symlink      || echo BAD: dir_symlink
test ! -L dir/file         && test   -f dir/file         || echo BAD: dir/file
test ! -L dir/file_symlink && test   -f dir/file_symlink || echo BAD: dir/file_symlink

PASS: cp -RHL
======================
echo -ne '' >input
echo -ne '' | echo -ne '\x42\x5a\x68\x39\x31\x41\x59\x26\x53\x59\x64\x1e\x91\x8c\x00\x00\x48\x7f\x80\x4c\x48\x08\x00\x28\x01\xff\xe0\x3f\x24\x14\x00\x0e\x20\xdc\x60\x20\x00\x92\x11\xea\xa0\x1a\x00\x00\x00\x03\x20\x8a\x93\xd4\x9a\x68\x1a\x0d\x1e\x91\xa1\xa0\x06\x98\xe3\x5c\x2f\xd9\x26\xa1\x25\x24\x20\xed\x47\xc7\x21\x40\x2b\x6e\xf2\xe6\xfe\x98\x13\x68\xa8\xbd\x82\xb2\x4f\x26\x02\x24\x16\x5b\x22\x16\x72\x74\x15\xcd\xc1\xa6\x9e\xa6\x5e\x6c\x16\x37\x35\x01\x99\xc4\x81\x21\x29\x28\x4b\x69\x51\xa9\x3c\x1a\x9b\x0a\xe1\xe4\xb4\xaf\x85\x73\xba\x23\x10\x59\xe8\xb3\xe1\xa1\x63\x05\x8c\x4f\xc5\xdc\x91\x4e\x14\x24\x19\x07\xa4\x63\x00' | bzcat | cpio -i 2>&1; echo $?;
ls -ln cpio.testdir | sed 's/  */ /g' | cut -d' ' -f 1-5,9- | grep -v '^total '
PASS: cpio extracts zero-sized hardlinks
SKIP: cpio extracts zero-sized hardlinks 2
SKIP: cpio -p with absolute paths
SKIP: cpio restores suid/sgid bits
======================
echo -ne '' >input
echo -ne '' | echo -ne '\x42\x5a\x68\x39\x31\x41\x59\x26\x53\x59\x64\x1e\x91\x8c\x00\x00\x48\x7f\x80\x4c\x48\x08\x00\x28\x01\xff\xe0\x3f\x24\x14\x00\x0e\x20\xdc\x60\x20\x00\x92\x11\xea\xa0\x1a\x00\x00\x00\x03\x20\x8a\x93\xd4\x9a\x68\x1a\x0d\x1e\x91\xa1\xa0\x06\x98\xe3\x5c\x2f\xd9\x26\xa1\x25\x24\x20\xed\x47\xc7\x21\x40\x2b\x6e\xf2\xe6\xfe\x98\x13\x68\xa8\xbd\x82\xb2\x4f\x26\x02\x24\x16\x5b\x22\x16\x72\x74\x15\xcd\xc1\xa6\x9e\xa6\x5e\x6c\x16\x37\x35\x01\x99\xc4\x81\x21\x29\x28\x4b\x69\x51\xa9\x3c\x1a\x9b\x0a\xe1\xe4\xb4\xaf\x85\x73\xba\x23\x10\x59\xe8\xb3\xe1\xa1\x63\x05\x8c\x4f\xc5\xdc\x91\x4e\x14\x24\x19\x07\xa4\x63\x00' | bzcat | cpio -id 2>&1; echo $?
PASS: cpio extracts in existing directory
SKIP: cpio uses by default uid/gid
SKIP: cpio -R with create
SKIP: cpio -R with extract
PASS: cut-cuts-a-character
PASS: cut-cuts-a-closed-range
PASS: cut-cuts-a-field
PASS: cut-cuts-an-open-range
PASS: cut-cuts-an-unclosed-range
======================
echo -ne 'the quick brown fox\n' >input
echo -ne 'jumps over the lazy dog\n' | cut -d' ' -f2 - input
PASS: cut '-' (stdin) and multi file handling
======================
echo -ne 'one:two:three:four:five:six:seven
alpha:beta:gamma:delta:epsilon:zeta:eta:theta:iota:kappa:lambda:mu
the quick brown fox jumps over the lazy dog
' >input
echo -ne '' | cut -b 3,3,3 input
PASS: cut -b a,a,a
======================
echo -ne 'one:two:three:four:five:six:seven
alpha:beta:gamma:delta:epsilon:zeta:eta:theta:iota:kappa:lambda:mu
the quick brown fox jumps over the lazy dog
' >input
echo -ne '' | cut -b 1-3,2-5,7-9,9-10 input
PASS: cut -b overlaps
======================
echo -ne 'one:two:three:four:five:six:seven
alpha:beta:gamma:delta:epsilon:zeta:eta:theta:iota:kappa:lambda:mu
the quick brown fox jumps over the lazy dog
' >input
echo -ne '' | cut -b 3-8,4-6 input
PASS: -b encapsulated
======================
echo -ne 'one:two:three:four:five:six:seven
alpha:beta:gamma:delta:epsilon:zeta:eta:theta:iota:kappa:lambda:mu
the quick brown fox jumps over the lazy dog
' >input
echo -ne '' | cut -b 8-3 abc.txt 2>/dev/null || echo err
PASS: cut high-low error
======================
echo -ne 'one:two:three:four:five:six:seven
alpha:beta:gamma:delta:epsilon:zeta:eta:theta:iota:kappa:lambda:mu
the quick brown fox jumps over the lazy dog
' >input
echo -ne '' | cut -c 4-10 input
PASS: cut -c a-b
======================
echo -ne 'one:two:three:four:five:six:seven
alpha:beta:gamma:delta:epsilon:zeta:eta:theta:iota:kappa:lambda:mu
the quick brown fox jumps over the lazy dog
' >input
echo -ne '' | cut -c 41- input
PASS: cut -c a-
======================
echo -ne 'one:two:three:four:five:six:seven
alpha:beta:gamma:delta:epsilon:zeta:eta:theta:iota:kappa:lambda:mu
the quick brown fox jumps over the lazy dog
' >input
echo -ne '' | cut -c -39 input
PASS: cut -c -b
======================
echo -ne 'one:two:three:four:five:six:seven
alpha:beta:gamma:delta:epsilon:zeta:eta:theta:iota:kappa:lambda:mu
the quick brown fox jumps over the lazy dog
' >input
echo -ne '' | cut -c 40 input
PASS: cut -c a
======================
echo -ne 'one:two:three:four:five:six:seven
alpha:beta:gamma:delta:epsilon:zeta:eta:theta:iota:kappa:lambda:mu
the quick brown fox jumps over the lazy dog
' >input
echo -ne '' | cut -c 3,5-7,10 input
PASS: cut -c a,b-c,d
======================
echo -ne 'one:two:three:four:five:six:seven
alpha:beta:gamma:delta:epsilon:zeta:eta:theta:iota:kappa:lambda:mu
the quick brown fox jumps over the lazy dog
' >input
echo -ne '' | cut -d ':' -f 5- input
PASS: cut -f a-
======================
echo -ne 'one:two:three:four:five:six:seven
alpha:beta:gamma:delta:epsilon:zeta:eta:theta:iota:kappa:lambda:mu
the quick brown fox jumps over the lazy dog
' >input
echo -ne '' | cut -d ' ' -f 3 input
PASS: cut show whole line with no delim
======================
echo -ne '' >input
echo -ne '' | echo 'ref_categorie=test' | cut -c 1-15 
PASS: cut with echo, -c (a-b)
======================
echo -ne '' >input
echo -ne '' | echo 'ref_categorie=test' | cut -c 14
PASS: cut with echo, -c (a)
======================
echo -ne 'abcdefghijklmnopqrstuvwxyz' >input
echo -ne '' | cut -c 4,5,20 input
PASS: cut with -c (a,b,c)
======================
echo -ne 'abcdefghijklmnopqrstuvwxyz' >input
echo -ne '' | cut -b 4,5,20 input
PASS: cut with -b (a,b,c)
======================
echo -ne '406378:Sales:Itorre:Jan
031762:Marketing:Nasium:Jim
636496:Research:Ancholie:Mel
396082:Sales:Jucacion:Ed
' >input
echo -ne '' | cut -d: -f3 -s input
PASS: cut with -d -f(:) -s
======================
echo -ne '406378:Sales:Itorre:Jan
031762:Marketing:Nasium:Jim
636496:Research:Ancholie:Mel
396082:Sales:Jucacion:Ed
' >input
echo -ne '' | cut -d' ' -f3 -s input && echo yes
PASS: cut with -d -f( ) -s
======================
echo -ne '406378:Sales:Itorre:Jan
031762:Marketing:Nasium:Jim
636496:Research:Ancholie:Mel
396082:Sales:Jucacion:Ed
' >input
echo -ne '' | cut -da -f3 -s input
PASS: cut with -d -f(a) -s
======================
echo -ne '406378:Sales:Itorre:Jan
031762:Marketing:Nasium:Jim
636496:Research:Ancholie:Mel
396082:Sales:Jucacion:Ed
' >input
echo -ne '' | cut -da -f3 -s -n input
PASS: cut with -d -f(a) -s -n
======================
echo -ne '' >input
echo -ne 'Bother, said Pooh. It's your husband, and he has a gun.
Cheerios are donut seeds.
Talk is cheap because supply exceeds demand.
Weather forecast for tonight : dark.
Apple: you can buy better, but you can't pay more.
Subcalifragilisticexpialidocious.
Auntie Em: Hate you, hate Kansas. Took the dog. Dorothy.' | cut -DF 2,7,5
PASS: cut -DF
======================
echo -ne '' >input
echo -ne 'a::b\n' | cut -d ':' -f 1-3
PASS: cut empty field
======================
echo -ne '' >input
echo -ne 'a::b::c:d\n' | cut -d ':' -f 3-5
PASS: cut empty field 2
PASS: date-@-works
PASS: date-R-works
PASS: date-format-works
SKIP: date-timezone
PASS: date-u-works
PASS: date-works
PASS: date-works-1
======================
echo -ne '' >input
echo -ne '10 20+p' | dc
PASS: dc basic syntax (stdin, multiple args)
======================
echo -ne '' >input
echo -ne '' | dc -e'10 20+p'
PASS: dc basic syntax (argv, single arg)
======================
echo -ne '' >input
echo -ne '' | dc -e10 -e20+p
PASS: dc basic syntax (argv, multiple args)
======================
echo -ne '' >input
echo -ne '' | dc -e'8 8 * 2 2 + / p'
PASS: dc complex with spaces (single arg)
======================
echo -ne '' >input
echo -ne '' | dc -e'8 8*2 2+/p'
PASS: dc complex without spaces (single arg)
======================
echo -ne '' >input
echo -ne '' | dc -e8 -e8 -e\* -e2 -e2 -e+ -e/ -ep
PASS: dc complex with spaces (multiple args)
======================
echo -ne '' >input
echo -ne '' | dc -e8 -e8\*2 -e2+/p
PASS: dc complex without spaces (multiple args)
SKIP: dc: x should execute strings
SKIP: dc: x should not execute or pop non-strings
SKIP: dc: x should work with strings created from a
SKIP: dc: p should print invalid escapes
SKIP: dc: p should print trailing backslashes
SKIP: dc: p should parse/print single backslashes
SKIP: dc: p should print single backslash strings
SKIP: dc read
SKIP: dc read string
SKIP: dc '>a' (conditional execute string) 1
SKIP: dc '>a' (conditional execute string) 2
SKIP: dc '>aeb' (conditional execute string with else)
SKIP: dc space can be a register
SKIP: dc newline can be a register
SKIP: dc Z (length) for numbers
SKIP: dc dc_add.dc
SKIP: dc dc_boolean.dc
SKIP: dc dc_decimal.dc
SKIP: dc dc_divide.dc
SKIP: dc dc_divmod.dc
SKIP: dc dc_misc.dc
SKIP: dc dc_modexp.dc
SKIP: dc dc_modulus.dc
SKIP: dc dc_multiply.dc
SKIP: dc dc_power.dc
SKIP: dc dc_sqrt.dc
SKIP: dc dc_strings.dc
SKIP: dc dc_subtract.dc
SKIP: dc -x dcx_vars.dc
PASS: dd-accepts-if
PASS: dd-accepts-of
PASS: dd-copies-from-standard-input-to-standard-output
SKIP: dd-count-bytes
PASS: dd-prints-count-to-standard-error
PASS: dd-reports-write-errors
======================
echo -ne 'qwe\nasd\nzxc\n' >input
echo -ne 'asd\n' | diff -u - input | sed 's/	.*//'
PASS: diff of stdin
======================
echo -ne 'qwe\nasd\nzxc' >input
echo -ne 'asd\n' | diff -u - input | sed 's/	.*//'
PASS: diff of stdin, no newline in the file
======================
echo -ne '' >input
echo -ne 'stdin' | diff - -; echo $?; wc -c
PASS: diff of stdin, twice
======================
echo -ne '' >input
echo -ne 'a\n' | diff -u - input | sed 's/	.*//'
PASS: diff of empty file against stdin
======================
echo -ne 'a\n' >input
echo -ne '' | diff -u - input | sed 's/	.*//'
PASS: diff of empty file against nonempty one
======================
echo -ne 'abc' >input
echo -ne 'abc ' | diff -ub - input; echo $?
PASS: diff -b treats EOF as whitespace
======================
echo -ne 'a \t c\n' >input
echo -ne 'a\t \tc\n' | diff -ub - input; echo $?
PASS: diff -b treats all spaces as equal
======================
echo -ne 'a\n' >input
echo -ne '\na\n\n' | diff -uB - input; echo $?
PASS: diff -B ignores changes whose lines are all blank
======================
echo -ne 'a\n' >input
echo -ne '\nb\n\n' | diff -uB - input | sed 's/	.*//'
PASS: diff -B does not ignore changes whose lines are not all blank
======================
echo -ne '\n1\n' >input
echo -ne '1\n' | diff -qB - input; echo $?
PASS: diff -B ignores blank single line change
======================
echo -ne '0\n' >input
echo -ne '1\n' | diff -qB - input; echo $?
PASS: diff -B does not ignore non-blank single line change
======================
echo -ne 'abc\na  c\ndef\n' >input
echo -ne 'a c\n' | diff -ub - input | sed 's/	.*//'
PASS: diff always takes context from old file
======================
echo -ne '' >input
echo -ne '' | diff -ur diff1 diff2/subdir | sed 's/	.*//'
PASS: diff diff1 diff2/subdir
======================
echo -ne '' >input
echo -ne '' | diff -ur diff1 diff2/subdir/- | sed 's/	.*//'
PASS: diff dir dir2/file/-
======================
echo -ne '' >input
echo -ne '' | diff -ur diff1 diff2/subdir | sed 's/	.*//'
PASS: diff of dir and fifo
======================
echo -ne '' >input
echo -ne '' | diff -ur diff1 diff2/subdir | sed 's/	.*//'
PASS: diff of file and fifo
======================
echo -ne '' >input
echo -ne '' | diff -urN diff1 diff2/subdir | sed 's/	.*//'
PASS: diff -rN does not read non-regular files
======================
echo -ne '' >input
echo -ne '' | diff -ur diff1 diff2/ | sed 's/	.*//'; diff -ur .///diff1 diff2//// | sed 's/	.*//'
PASS: diff diff1 diff2/
PASS: dirname-handles-absolute-path
PASS: dirname-handles-empty-path
PASS: dirname-handles-multiple-slashes
PASS: dirname-handles-relative-path
PASS: dirname-handles-root
PASS: dirname-handles-single-component
PASS: dirname-works
PASS: du-h-works
PASS: du-k-works
PASS: du-l-works
PASS: du-m-works
PASS: du-s-works
PASS: du-works
PASS: echo-does-not-print-newline
PASS: echo-prints-argument
PASS: echo-prints-arguments
SKIP: echo-prints-dash
PASS: echo-prints-newline
SKIP: echo-prints-non-opts
SKIP: echo-prints-slash-zero
SKIP: echo-prints-slash_00041
SKIP: echo-prints-slash_0041
SKIP: echo-prints-slash_041
SKIP: echo-prints-slash_41
PASS: expr-big
PASS: expr-works
PASS: false-is-silent
PASS: false-returns-failure
PASS: find-supports-minus-xdev
======================
echo -ne '' >input
echo -ne '' | cd find.tempdir && find -type f 2>&1
PASS: find -type f
======================
echo -ne '' >input
echo -ne '' | cd find.tempdir && find testfile -exec true {} \; 2>&1; echo $?
PASS: find -exec exitcode 1
======================
echo -ne '' >input
echo -ne '' | cd find.tempdir && find testfile -exec true {} + 2>&1; echo $?
PASS: find -exec exitcode 2
======================
echo -ne '' >input
echo -ne '' | cd find.tempdir && find testfile -exec false {} \; 2>&1; echo $?
PASS: find -exec exitcode 3
======================
echo -ne '' >input
echo -ne '' | cd find.tempdir && find testfile -exec false {} + 2>&1; echo $?
PASS: find -exec exitcode 4
======================
echo -ne '' >input
echo -ne '' | find / -maxdepth 0 -name /
PASS: find / -maxdepth 0 -name /
======================
echo -ne '' >input
echo -ne '' | find // -maxdepth 0 -name /
PASS: find // -maxdepth 0 -name /
======================
echo -ne '' >input
echo -ne '' | find / -maxdepth 0 -name //
PASS: find / -maxdepth 0 -name //
======================
echo -ne '' >input
echo -ne '' | find // -maxdepth 0 -name //
PASS: find // -maxdepth 0 -name //
======================
echo -ne '' >input
echo -ne '' | find ./// -name .
PASS: find ./// -name .
======================
echo -ne '' >input
echo -ne '' | find ./// -name .///
PASS: find ./// -name .///
======================
echo -ne '' >input
echo -ne '' | grep nonexistent 2> /dev/null ; echo $?
PASS: grep (exit with error)
======================
echo -ne '' >input
echo -ne '' | grep grep '/usr/lib/busybox/ptest/testsuite/grep.tests' > /dev/null 2>&1 ; echo $?
PASS: grep (exit success)
======================
echo -ne '' >input
echo -ne 'one\ntwo\nthree\nthree\nthree\n' | grep two
PASS: grep (default to stdin)
======================
echo -ne '' >input
echo -ne 'one\ntwo\nthree\nthree\nthree\n' | grep two -
PASS: grep - (specify stdin)
======================
echo -ne 'one\ntwo\nthree\nthree\nthree\n' >input
echo -ne '' | grep two input
PASS: grep input (specify file)
======================
echo -ne 'bug' >input
echo -ne '' | grep bug input
PASS: grep (no newline at EOL)
======================
echo -ne 'one\ntwo\nthree\nthree\nthree\n' >input
echo -ne '' | grep two input empty 2>/dev/null
PASS: grep two files
======================
echo -ne 'one\ntwo\nthree\n' >input
echo -ne 'one\ntwo\ntoo\nthree\nthree\n' | grep two - input
PASS: grep - infile (specify stdin and file)
======================
echo -ne '' >input
echo -ne 'one\ntwo\ntwo\nthree\nthree\nthree\n' | grep two - nonexistent 2> /dev/null ; echo $?
PASS: grep - nofile (specify stdin and nonexisting file)
======================
echo -ne '' >input
echo -ne 'one\ntwo\ntwo\nthree\nthree\nthree\n' | grep -q nomatch - nonexistent 2> /dev/null ; echo $?
PASS: grep -q - nofile (specify stdin and nonexisting file, no match)
======================
echo -ne '' >input
echo -ne 'one\ntwo\ntwo\nthree\nthree\nthree\n' | grep -q two - nonexistent ; echo $?
PASS: grep -q - nofile (specify stdin and nonexisting file, match)
======================
echo -ne '' >input
echo -ne '' | grep -s nomatch nonexistent ; echo $?
PASS: grep -s nofile (nonexisting file, no match)
======================
echo -ne '' >input
echo -ne 'nomatch\ndomatch\nend\n' | grep -s domatch nonexistent - ; echo $?
PASS: grep -s nofile - (stdin and nonexisting file, match)
SKIP: grep handles NUL in files
SKIP: grep handles NUL on stdin
SKIP: grep matches NUL
======================
echo -ne 'one\ntwo\n' >input
echo -ne '' | grep -e one -e two input ; echo $?
PASS: grep handles multiple regexps
======================
echo -ne 'one\ntwo\n' >input
echo -ne '' | grep -F -e one -e two input ; echo $?
PASS: grep -F handles multiple expessions
======================
echo -ne 'FOO\n' >input
echo -ne '' | grep -F -i foo input ; echo $?
PASS: grep -F handles -i
======================
echo -ne 'tw\ntwo\nthree\n' >input
echo -ne 'tw.\nthr\n' | grep -f - input ; echo $?
PASS: grep can read regexps from stdin
======================
echo -ne 'foo\n' >input
echo -ne '' | grep -x foo input ; echo $?
PASS: grep -x (full match)
======================
echo -ne 'foo bar\n' >input
echo -ne '' | grep -x foo input ; echo $?
PASS: grep -x (partial match 1)
======================
echo -ne 'bar foo\n' >input
echo -ne '' | grep -x foo input ; echo $?
PASS: grep -x (partial match 2)
======================
echo -ne 'foo\n' >input
echo -ne '' | grep -x -F foo input ; echo $?
PASS: grep -x -F (full match)
======================
echo -ne 'foo bar\n' >input
echo -ne '' | grep -x -F foo input ; echo $?
PASS: grep -x -F (partial match 1)
======================
echo -ne 'bar foo\n' >input
echo -ne '' | grep -x -F foo input ; echo $?
PASS: grep -x -F (partial match 2)
======================
echo -ne 'asd\n' >input
echo -ne '' | grep -L qwe input; echo $?
PASS: grep -L exitcode 0
======================
echo -ne 'qwe\n' >input
echo -ne 'asd\n' | grep -L qwe input -; echo $?
PASS: grep -L exitcode 0 #2
======================
echo -ne 'qwe\n' >input
echo -ne '' | grep -L qwe input; echo $?
PASS: grep -L exitcode 1
======================
echo -ne '' >input
echo -ne 'b\ar\nfoo\nbaz' | grep -E fo+
PASS: grep -E supports extended regexps
======================
echo -ne '' >input
echo -ne 'foo\nbar\n' | egrep foo
PASS: grep is also egrep
======================
echo -ne '' >input
echo -ne 'FOO\n' | egrep foo ; [ $? -ne 0 ] && echo yes
PASS: egrep is not case insensitive
======================
echo -ne '' >input
echo -ne '00:19:3E:00:AA:5E 00:1D:60:3D:3A:FB 00:22:43:49:FB:AA\n' | grep -E -o '([[:xdigit:]]{2}[:-]){5}[[:xdigit:]]{2}'
PASS: grep -E -o prints all matches
======================
echo -ne '' >input
echo -ne '/var/test\n' | grep -o "[^/]*$"
PASS: grep -o does not loop forever
======================
echo -ne '' >input
echo -ne 'test\n' | grep -o "" | head -n1
PASS: grep -o does not loop forever on zero-length match
======================
echo -ne '' >input
echo -ne 'test\n' | grep -f input
PASS: grep -f EMPTY_FILE
======================
echo -ne '' >input
echo -ne 'test\n' | grep -v -f input
PASS: grep -v -f EMPTY_FILE
======================
echo -ne '' >input
echo -ne 'test\n' | grep -vxf input
PASS: grep -vxf EMPTY_FILE
======================
echo -ne 'foop\n' >input
echo -ne '' | grep -Fw foo input
PASS: grep -Fw matches only words
======================
echo -ne 'foop foo\n' >input
echo -ne '' | grep -Fw foo input
PASS: grep -Fw doesn't stop on 1st mismatch
======================
echo -ne 'foop foo\n' >input
echo -ne '' | grep -w foo input
PASS: grep -w doesn't stop on 1st mismatch
======================
echo -ne 'strstr\n' >input
echo -ne '' | grep -w ^str input
PASS: grep -w ^str doesn't match str not at the beginning
======================
echo -ne 'anything\n' >input
echo -ne '' | grep -w ^ input
PASS: grep -w ^ doesn't hang
======================
echo -ne 'wordword\n' >input
echo -ne '' | grep -w word input
PASS: grep -w word doesn't match wordword
======================
echo -ne 'ww\n' >input
echo -ne '' | grep -F -w w input
PASS: grep -F -w w doesn't match ww
======================
echo -ne 'bword,word\nwordb,word\nbwordb,word\n' >input
echo -ne '' | grep -w word input
PASS: grep -w word match second word
======================
echo -ne '' >input
echo -ne '  aa bb cc\n' | grep -x -v -e '.*aa.*' -e 'bb.*'; echo $?
PASS: grep -x -v -e EXP1 -e EXP2 finds nothing if either EXP matches
======================
echo -ne '' >input
echo -ne 'foo\nbar\nbaz\n' | grep -Fv "$(printf "foo\nbar\n")"
PASS: grep PATTERN can be a newline-delimited list
======================
echo -ne '' >input
echo -ne 'foo\nbar\nbaz\n' | grep -Fv -e "$(printf "foo\nbar\n")"
PASS: grep -e PATTERN can be a newline-delimited list
======================
echo -ne '' >input
echo -ne '' | grep -r . grep.testdir/symfoo
PASS: grep -r on symlink to dir
======================
echo -ne '' >input
echo -ne '' | grep -r . grep.testdir
PASS: grep -r on dir/symlink to dir
PASS: gunzip-reads-from-standard-input
PASS: gunzip: doesnt exist
PASS: gunzip: unknown suffix
PASS: gunzip: already exists
PASS: gunzip: stream unpack
PASS: gunzip: delete src
PASS: gzip-accepts-multiple-files
PASS: gzip-accepts-single-minus
SKIP: gzip-compression-levels
PASS: gzip-removes-original-file
======================
echo -ne '' >input
echo -ne '' | head head.input
PASS: head (without args)
======================
echo -ne '' >input
echo -ne '' | head -n 2 head.input
PASS: head -n <positive number>
SKIP: head -n <negative number>
======================
echo -ne '' >input
echo -ne '\0\0\0\0' | hexdump -C
PASS: hexdump -C with four NULs
======================
echo -ne '' >input
echo -ne '\0\0\0\0\0\0\0\0\0\0\0' | hexdump -e '1/1 "%02x|"1/1 "%02x!\n"'
PASS: hexdump does not think last padded block matches any full block
======================
echo -ne '' >input
echo -ne '\0\0\0\0\0\0\0\0\0\0\0\0' | hexdump -e '1/1 "%02x|"1/1 "%02x!\n"'
PASS: hexdump thinks last full block can match
PASS: hostname-d-works
PASS: hostname-i-works
PASS: hostname-s-works
PASS: hostname-works
PASS: id-g-works
PASS: id-u-works
PASS: id-un-works
PASS: id-ur-works
PASS: ln-creates-hard-links
PASS: ln-creates-soft-links
PASS: ln-force-creates-hard-links
PASS: ln-force-creates-soft-links
PASS: ln-preserves-hard-links
PASS: ln-preserves-soft-links
PASS: ls-1-works
PASS: ls-h-works
PASS: ls-l-works
PASS: ls-s-works
======================
echo -ne '' >input
echo -ne '' | (cd ls.testdir && sh ../ls.mk_uni_tests) && ls -1 ls.testdir
PASS: ls unicode test with codepoints limited to 767
======================
echo -ne '' >input
echo -ne '' | touch ls.testdir/A ls.testdir/B; ln -s ls.testdir ls.link; ls ls.link; ls -1 ls.link/; ls -1 ls.link; rm -f ls.link
PASS: ls symlink_to_dir
PASS: md5sum-verifies-non-binary-file
SKIP: md5sum
PASS: mkdir-makes-a-directory
PASS: mkdir-makes-parent-directories
SKIP: mount
PASS: mv-files-to-dir
PASS: mv-files-to-dir-2
PASS: mv-follows-links
PASS: mv-moves-empty-file
PASS: mv-moves-file
PASS: mv-moves-hardlinks
PASS: mv-moves-large-file
PASS: mv-moves-small-file
PASS: mv-moves-symlinks
PASS: mv-moves-unreadable-files
SKIP: mv-preserves-hard-links
PASS: mv-preserves-links
PASS: mv-refuses-mv-dir-to-subdir
PASS: mv-removes-source-file
SKIP: od -b
SKIP: od -f
SKIP: od -b --traditional
SKIP: od -b --traditional FILE
======================
echo -ne 'qwe
zxc
' >input
echo -ne '--- input	Jan 01 01:01:01 2000
+++ input	Jan 01 01:01:01 2000
@@ -1,2 +1,3 @@
 qwe
+asd
 zxc
' | patch 2>&1; echo $?; cat input
PASS: patch with old_file == new_file
======================
echo -ne 'qwe
zxc
' >input
echo -ne '--- input.doesnt_exist	Jan 01 01:01:01 2000
+++ input	Jan 01 01:01:01 2000
@@ -1,2 +1,3 @@
 qwe
+asd
 zxc
' | patch 2>&1; echo $?; cat input
PASS: patch with nonexistent old_file
======================
echo -ne 'qwe
asd
zxc
' >input
echo -ne '--- input.doesnt_exist	Jan 01 01:01:01 2000
+++ input	Jan 01 01:01:01 2000
@@ -1,2 +1,3 @@
 qwe
+asd
 zxc
' | patch -R 2>&1; echo $?; cat input
PASS: patch -R with nonexistent old_file
======================
echo -ne 'abc
def
123
' >input
echo -ne '--- input.old	Jan 01 01:01:01 2000
+++ input	Jan 01 01:01:01 2000
@@ -1,2 +1,3 @@
 abc
+def
 123
' | patch 2>&1; echo $?; cat input
PASS: patch detects already applied hunk
======================
echo -ne 'abc
123
456
' >input
echo -ne '--- input.old	Jan 01 01:01:01 2000
+++ input	Jan 01 01:01:01 2000
@@ -1,2 +1,3 @@
 abc
 123
+456
' | patch 2>&1; echo $?; cat input
PASS: patch detects already applied hunk at the EOF
======================
echo -ne 'abc
def
123
' >input
echo -ne '--- input
+++ input
@@ -1,2 +1,3 @@
 abc
+def
 123
' | patch -N 2>&1; echo $?; cat input
PASS: patch -N ignores already applied hunk
======================
echo -ne 'abc
123
' >input
echo -ne '--- foo.old
+++ foo
@@ -1,2 +1,3 @@
 abc
+def
 123
' | cat >a.patch; patch input a.patch 2>&1; echo $?; cat input; rm a.patch
PASS: patch FILE PATCH
======================
echo -ne '111
222
333
444
555
666
777
888
999
' >input
echo -ne '--- input
+++ input
@@ -1,6 +1,4 @@
-111
-222
-333
+111changed
 444
 555
 666
' | patch 2>&1; cat input
PASS: patch at the beginning
======================
echo -ne '' >input
echo -ne '--- /dev/null
+++ testfile
@@ -0,0 +1 @@
+qwerty
' | patch 2>&1; echo $?; cat testfile; rm testfile
PASS: patch creates new file
======================
echo -ne '' >input
echo -ne '--- bogus_dir///dir2///file
+++ bogus_dir///dir2///file
@@ -1,2 +1,3 @@
 qwe
+asd
 zxc
' | patch -p1 2>&1; echo $?
PASS: patch understands ...dir///dir...
======================
echo -ne 'foo







bar
' >input
echo -ne '--- a/input.orig
+++ b/input
@@ -5,5 +5,8 @@ foo
 
 
 
+1
+2
+3
 
 bar
-- 
2.9.2
' | patch -p1 2>&1; echo $?; cat input
PASS: patch internal buffering bug?
======================
echo -ne '' >input
echo -ne '' | pidof veryunlikelyoccuringbinaryname ; echo $?
PASS: pidof (exit with error)
======================
echo -ne '' >input
echo -ne '' | pidof pidof > /dev/null; echo $?
PASS: pidof (exit with success)
======================
echo -ne '' >input
echo -ne '' | pidof pidof.tests | grep -o -w 3279
PASS: pidof this
SKIP: pidof -s
SKIP: pidof -o %PPID NOP
SKIP: pidof -o init
======================
echo -ne '' >input
echo -ne '' | busybox printf '\c' foo
PASS: printf produces no further output 1
======================
echo -ne '' >input
echo -ne '' | busybox printf '%s\c' foo bar
PASS: printf produces no further output 2
======================
echo -ne '' >input
echo -ne '' | busybox printf '%s\n' foo '/home/root'
PASS: printf repeatedly uses pattern for each argv
======================
echo -ne '' >input
echo -ne '' | busybox printf '%b' 'a\tb' 'c\d\n' 2>&1; echo $?
PASS: printf understands %b escaped_string
======================
echo -ne '' >input
echo -ne '' | busybox printf '%d\n' '"x' "'y" "'zTAIL" 2>&1; echo $?
PASS: printf understands %d '"x' "'y" "'zTAIL"
======================
echo -ne '' >input
echo -ne '' | busybox printf '%s\n' '"x' "'y" "'zTAIL" 2>&1; echo $?
PASS: printf understands %s '"x' "'y" "'zTAIL"
======================
echo -ne '' >input
echo -ne '' | busybox printf '|%23.12f|\n' 5.25 2>&1; echo $?
PASS: printf understands %23.12f
======================
echo -ne '' >input
echo -ne '' | busybox printf '|%*.*f|\n' 23 12 5.25 2>&1; echo $?
PASS: printf understands %*.*f
======================
echo -ne '' >input
echo -ne '' | busybox printf '|%*f|\n' -23 5.25 2>&1; echo $?
PASS: printf understands %*f with negative width
======================
echo -ne '' >input
echo -ne '' | busybox printf '|%.*f|\n' -12 5.25 2>&1; echo $?
PASS: printf understands %.*f with negative precision
======================
echo -ne '' >input
echo -ne '' | busybox printf '|%*.*f|\n' -23 -12 5.25 2>&1; echo $?
PASS: printf understands %*.*f with negative width/precision
======================
echo -ne '' >input
echo -ne '' | busybox printf '%zd\n' -5 2>&1; echo $?
PASS: printf understands %zd
======================
echo -ne '' >input
echo -ne '' | busybox printf '%ld\n' -5 2>&1; echo $?
PASS: printf understands %ld
======================
echo -ne '' >input
echo -ne '' | busybox printf '%Ld\n' -5 2>&1; echo $?
PASS: printf understands %Ld
======================
echo -ne '' >input
echo -ne '' | busybox printf '%%\n' 2>&1; echo $?
PASS: printf understands %%
======================
echo -ne '' >input
echo -ne '' | busybox printf '%d\n' 3 +3 '   3' '   +3' 2>&1; echo $?
PASS: printf handles positive numbers for %d
======================
echo -ne '' >input
echo -ne '' | busybox printf '%i\n' 3 +3 '   3' '   +3' 2>&1; echo $?
PASS: printf handles positive numbers for %i
======================
echo -ne '' >input
echo -ne '' | busybox printf '%x\n' 42 +42 '   42' '   +42' 2>&1; echo $?
PASS: printf handles positive numbers for %x
======================
echo -ne '' >input
echo -ne '' | busybox printf '%0.3f\n' .42 +.42 '   .42' '   +.42' 2>&1; echo $?
PASS: printf handles positive numbers for %f
======================
echo -ne '' >input
echo -ne '' | busybox printf '%d\n' 1 - 2 bad 3 123bad 4 2>&1; echo $?
PASS: printf handles %d bad_input
======================
echo -ne '' >input
echo -ne '' | busybox printf '%' a b c 2>&1; echo $?
PASS: printf aborts on bare %
======================
echo -ne '' >input
echo -ne '' | busybox printf '%r' a b c 2>&1; echo $?
PASS: printf aborts on %r
======================
echo -ne '' >input
echo -ne '' | busybox printf '%0*d\n' 2 1 2>&1; echo $?
PASS: printf treats leading 0 as flag
======================
echo -ne '' >input
echo -ne '' | busybox printf '%0 d\n' 2 2>&1; echo $?
PASS: printf handles multiple flags
PASS: pwd-prints-working-directory
======================
echo -ne '' >input
echo -ne '' | readlink ./readlink_testdir/testfile
PASS: readlink on a file
======================
echo -ne '' >input
echo -ne '' | readlink ./testlink
PASS: readlink on a link
======================
echo -ne '' >input
echo -ne '' | readlink -f ./readlink_testdir/testfile
PASS: readlink -f on a file
======================
echo -ne '' >input
echo -ne '' | readlink -f ./testlink
PASS: readlink -f on a link
======================
echo -ne '' >input
echo -ne '' | readlink -f ./readlink_testdir/readlink_testdir/testlink
PASS: readlink -f on an invalid link
======================
echo -ne '' >input
echo -ne '' | readlink -f readlink_testdir/../readlink_testdir/testfile
PASS: readlink -f on a weird dir
======================
echo -ne '' >input
echo -ne '' | realpath /not_file
PASS: realpath on non-existent absolute path 1
======================
echo -ne '' >input
echo -ne '' | realpath /not_file/
PASS: realpath on non-existent absolute path 2
======================
echo -ne '' >input
echo -ne '' | realpath //not_file
PASS: realpath on non-existent absolute path 3
======================
echo -ne '' >input
echo -ne '' | realpath /not_dir/not_file 2>&1
PASS: realpath on non-existent absolute path 4
======================
echo -ne '' >input
echo -ne '' | realpath realpath_testdir/not_file
PASS: realpath on non-existent local file 1
======================
echo -ne '' >input
echo -ne '' | realpath realpath_testdir/not_dir/not_file 2>&1
PASS: realpath on non-existent local file 2
======================
echo -ne '' >input
echo -ne '' | realpath link1
PASS: realpath on link to non-existent file 1
======================
echo -ne '' >input
echo -ne '' | realpath link2 2>&1
PASS: realpath on link to non-existent file 2
======================
echo -ne '' >input
echo -ne '' | realpath ./link1
PASS: realpath on link to non-existent file 3
======================
echo -ne '' >input
echo -ne '' | realpath ./link2 2>&1
PASS: realpath on link to non-existent file 4
======================
echo -ne 'line 1\n\nline 3\n' >input
echo -ne '' | rev input
PASS: rev works
======================
echo -ne 'line 1\n\nline 3' >input
echo -ne '' | rev input
PASS: rev file with missing newline
======================
echo -ne 'lin\000e 1\n\nline 3\n' >input
echo -ne '' | rev input
PASS: rev file with NUL character
======================
echo -ne '---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+--------------+\nabc\n' >input
echo -ne '' | rev input
PASS: rev file with long line
PASS: rm-removes-file
PASS: rmdir-removes-parent-directories
======================
echo -ne '' >input
echo -ne 'hello\n' | sed ""
PASS: sed no files (stdin)
======================
echo -ne '' >input
echo -ne 'hello\n' | sed "" -
PASS: sed explicit stdin
======================
echo -ne '' >input
echo -ne '\n' | sed -e 's/$/@/'
PASS: sed handles empty lines
======================
echo -ne '' >input
echo -ne 'hello' | sed "" - -
PASS: sed stdin twice
======================
echo -ne '' >input
echo -ne '' | sed -e '1 d'
PASS: sed accepts blanks before command
======================
echo -ne '' >input
echo -ne '2\n' | sed -e 'i1
a3'
PASS: sed accepts newlines in -e
======================
echo -ne '' >input
echo -ne '2\n' | sed -e 'i\' -e '1' -e 'a\' -e '3'
PASS: sed accepts multiple -e
======================
echo -ne '' >input
echo -ne 'foo\n' | sed -n -e s/foo/bar/ -e s/bar/baz/
PASS: sed -n
======================
echo -ne '' >input
echo -ne 'string\n' | sed 's/z*//g'
PASS: sed with empty match
======================
echo -ne '' >input
echo -ne 'foo\n' | sed -e s/foo/bar/p -e s/bar/baz/p
PASS: sed s//p
======================
echo -ne '' >input
echo -ne 'abc\n' | sed -ne s/abc/def/p
PASS: sed -n s//p
======================
echo -ne '' >input
echo -ne '12345\n' | sed -e 's/[[:space:]]*/,/g'
PASS: sed s//g (exhaustive)
======================
echo -ne '' >input
echo -ne 'woo\n' | sed -e 's woo boing '
PASS: sed s arbitrary delimiter
======================
echo -ne '' >input
echo -ne 'foo\n' | sed -e s/foo/bar/ -e s/bar/baz/
PASS: sed s chains
======================
echo -ne '' >input
echo -ne 'foo\n' | sed -e s/foo/bar/ -e s/baz/nee/
PASS: sed s chains2
======================
echo -ne '' >input
echo -ne 'one@two' | sed -e 's@[@]@@'
PASS: sed s [delimiter]
======================
echo -ne '' >input
echo -ne 'one\ttwo' | sed 's/\t/ /'
PASS: sed s with \t (GNU ext)
======================
echo -ne '' >input
echo -ne 'foo\n' | sed -e 'b one;p;: one'
PASS: sed b (branch)
======================
echo -ne '' >input
echo -ne 'foo\n' | sed -e 'b;p'
PASS: sed b (branch with no label jumps to end)
======================
echo -ne '' >input
echo -ne 'a\nb\nc\n' | sed -e 's/a/1/;t one;p;: one;p'
PASS: sed t (test/branch)
======================
echo -ne '' >input
echo -ne 'a\nb\nc\n' | sed -e 's/a/b/;:loop;t loop'
PASS: sed t (test/branch clears test bit)
======================
echo -ne '' >input
echo -ne 'a\nb\nc\n' | sed -e 's/a/1/;T notone;p;: notone;p'
PASS: sed T (!test/branch)
======================
echo -ne '' >input
echo -ne 'a\nb\nc\n' | sed -e 'n;p'
PASS: sed n (flushes pattern space, terminates early)
======================
echo -ne '' >input
echo -ne 'a\nb\nc\n' | sed -e 'N;p'
PASS: sed N (flushes pattern space (GNU behavior))
======================
echo -ne '' >input
echo -ne 'a\nb\nc\n' | sed ':a;N;s/\n/ /;ta'
PASS: sed N test2
======================
echo -ne '' >input
echo -ne 'a\nb\nc\n' | sed 'N;s/\n/ /'
PASS: sed N test3
======================
echo -ne '' >input
echo -ne 'a\nb\nc\nd\n' | sed "/b/N;/b\\nc/i woo"
PASS: sed address match newline
======================
echo -ne '' >input
echo -ne 'a\nb\nc\n' | sed -n 'N;P;p'
PASS: sed N (stops at end of input) and P (prints to first newline only)
======================
echo -ne '' >input
echo -ne 'a\nb\nc\n' | sed G
PASS: sed G (append hold space to pattern space)
======================
echo -ne '' >input
echo -ne 'ook\n' | sed -e '/ook/d;s/ook/ping/p;i woot'
PASS: sed d ends script iteration
======================
echo -ne '' >input
echo -ne 'ook\nwoot\n' | sed -e '/ook/d;a\' -e 'bang'
PASS: sed d ends script iteration (2)
======================
echo -ne '' >input
echo -ne 'woo\0woo\0' | sed -e 's/woo/bang/g'
PASS: sed embedded NUL g
======================
echo -ne 'woo\n' >input
echo -ne 'woo\n' | sed -e 's/woo/bang/' input -
PASS: sed normal newlines
======================
echo -ne 'woo\n' >input
echo -ne 'woo' | sed -e 's/woo/bang/' input -
PASS: sed leave off trailing newline
======================
echo -ne 'woo' >input
echo -ne 'woo' | sed -e 's/woo/bang/' input -
PASS: sed autoinsert newline
======================
echo -ne '' >input
echo -ne 'one\ntwo' | sed -e 's/nohit//' input -
PASS: sed empty file plus cat
======================
echo -ne 'one\ntwo' >input
echo -ne '' | sed -e 's/nohit//' input -
PASS: sed cat plus empty file
======================
echo -ne '' >input
echo -ne 'woot' | sed -e '/woot/a woo' -
PASS: sed append autoinserts newline
======================
echo -ne 'boot' >input
echo -ne 'woot' | sed -e '/oot/a woo' - input
PASS: sed append autoinserts newline 2
======================
echo -ne 'boot' >input
echo -ne '' | sed -e '/oot/a woo' -i input && cat input
PASS: sed append autoinserts newline 3
======================
echo -ne '' >input
echo -ne 'woot' | sed -e '/woot/i woo' -
PASS: sed insert doesn't autoinsert newline
======================
echo -ne '' >input
echo -ne 'one' | sed -e 'p' -
PASS: sed print autoinsert newlines
======================
echo -ne 'one' >input
echo -ne 'two' | sed -e 'p' input -
PASS: sed print autoinsert newlines two files
======================
echo -ne 'no\n' >input
echo -ne '' | sed -ne 's/woo/bang/' input
PASS: sed noprint, no match, no newline
======================
echo -ne 'a woo\nb no' >input
echo -ne 'c woo\nd no' | sed -ne 's/woo/bang/p' input -
PASS: sed selective matches with one nl
======================
echo -ne 'a woo\nb woo' >input
echo -ne 'c no\nd woo' | sed -ne 's/woo/bang/p' input -
PASS: sed selective matches insert newline
======================
echo -ne 'a woo\nb woo' >input
echo -ne 'c no\nd no' | sed -ne 's/woo/bang/p' input -
PASS: sed selective matches noinsert newline
======================
echo -ne 'one' >input
echo -ne 'two' | sed -e '/one/a 111' -e '/two/i 222' -e p input -
PASS: sed clusternewline
======================
echo -ne 'thingy' >input
echo -ne 'again' | sed -e 's/i/z/' -e 'woutputw' input -; echo -n X; cat outputw
PASS: sed subst+write
======================
echo -ne 'a\0b\0' >input
echo -ne 'c' | sed 's/i/z/' input -
PASS: sed trailing NUL
======================
echo -ne 'a' >input
echo -ne '' | sed 's/a/z\
z/' input
PASS: sed escaped newline in command
======================
echo -ne '' >input
echo -ne 'hello\nthere' | sed -e '$p'
PASS: sed match EOF
======================
echo -ne 'one\ntwo' >input
echo -ne 'three\nfour' | sed -e '$p' input -
PASS: sed match EOF two files
======================
echo -ne 'one\ntwo' >input
echo -ne '' | sed -e '$i ook' -i input input2 && cat input input2
PASS: sed match EOF inline
======================
echo -ne '' >input
echo -ne '' | sed --version | grep -o 'GNU sed version '
PASS: sed lie-to-autoconf
======================
echo -ne '' >input
echo -ne 'woot' | sed -e '/woot/s//eep \0 eep/'
PASS: sed backref from empty s uses range regex
======================
echo -ne '' >input
echo -ne 'woot\n' | sed -e '/woot/s//eep \0 eep/'
PASS: sed backref from empty s uses range regex with newline
======================
echo -ne '' >input
echo -ne '' | sed -e '' -i 2> /dev/null || echo yes
PASS: sed -i with no arg [GNUFAIL]
======================
echo -ne '' >input
echo -ne 'xxx\n' | sed -e 's/xxx/[/'
PASS: sed s/xxx/[/
======================
echo -ne '' >input
echo -ne '0\n1\n2\n3\n' | sed 's/1/x/;T;n;: next;s/3/y/;t quit;n;b next;: quit;q'
PASS: sed n command must reset 'substituted' bit
======================
echo -ne '' >input
echo -ne 'first\nsecond\nthird\nfourth\n' | sed -n '1d;1,3p'
PASS: sed d does not break n,m matching
======================
echo -ne '' >input
echo -ne 'first\nsecond\nthird\nfourth\n' | sed -n '1d;1,/hir/p'
PASS: sed d does not break n,regex matching
======================
echo -ne '' >input
echo -ne 'first\nsecond\nthird\nfourth\nfirst2\nsecond2\nthird2\nfourth2\n' | sed -n '1,5d;1,/hir/p'
PASS: sed d does not break n,regex matching #2
======================
echo -ne '' >input
echo -ne 'first\nsecond\nthird\nfourth\n' | sed -n '2d;2,1p'
PASS: sed 2d;2,1p (gnu compat)
======================
echo -ne '' >input
echo -ne '/usr/lib\n' | sed 's,\(^/\|\)[^/][^/]*,>\0<,g'
PASS: sed beginning (^) matches only once
======================
echo -ne '' >input
echo -ne 'first\nsecond\n' | sed 'crepl'
PASS: sed c
======================
echo -ne '' >input
echo -ne 'qwe\nasd\nzxc\n' | sed '/asd/ { p; /s/ { s/s/c/ }; p; q }'
PASS: sed nested {}s
======================
echo -ne '' >input
echo -ne '	| one \\
	| two \\
' | sed -e '/| one /a \
	| three \\' -e '/| one-/a \
	| three-* \\'
PASS: sed a cmd ended by double backslash
======================
echo -ne '' >input
echo -ne 'line1\n' | sed '/1/a\\t\rzero\none\\ntwo\\\nthree'
PASS: sed a cmd understands \n,\t,\r
======================
echo -ne '' >input
echo -ne 'line1\n' | sed '/1/i\\t\rzero\none\\ntwo\\\nthree'
PASS: sed i cmd understands \n,\t,\r
======================
echo -ne '' >input
echo -ne '1\n2\n3\n4\n' | sed -n '1{N;N;d};1p;2,3p;3p;4p'
PASS: sed with N skipping lines past ranges on next cmds
======================
echo -ne 'foo\n' >input
echo -ne '' | cp input input2; sed -i -e '1s/foo/bar/' input input2 && cat input input2; rm input2
PASS: sed -i with address modifies all files, not only first
======================
echo -ne '' >input
echo -ne 'rrr\n' | sed 's/r/\r/'
PASS: sed understands \r
======================
echo -ne '1\n2\n3\n4\n' >input
echo -ne '' | sed '1,2d' -i input; echo $?; cat input
PASS: sed -i finishes ranges correctly
======================
echo -ne '' >input
echo -ne 'helllo\n' | sed 's/l*/@/g'
PASS: sed zero chars match/replace advances correctly 1
======================
echo -ne '' >input
echo -ne ' a.b\n' | sed 's [^ .]* x g'
PASS: sed zero chars match/replace advances correctly 2
======================
echo -ne '' >input
echo -ne '_aaa1aa\n' | sed 's/a/A/g'
PASS: sed zero chars match/replace logic must not falsely trigger here 1
======================
echo -ne '' >input
echo -ne 'qwerty\n' | sed 's/ *$/_/g'
PASS: sed zero chars match/replace logic must not falsely trigger here 2
======================
echo -ne '' >input
echo -ne '9+8=17\n' | sed 's+9\++X+'
PASS: sed special char as s/// delimiter, in pattern
======================
echo -ne '' >input
echo -ne '9+8=17\n' | sed 's&9&X\&&'
PASS: sed special char as s/// delimiter, in replacement 1
======================
echo -ne '' >input
echo -ne '9+8=17\n' | sed 's1\(9\)1X\11'
PASS: sed special char as s/// delimiter, in replacement 2
======================
echo -ne '' >input
echo -ne 'this is a regular line
line with \
continuation
more regular lines
line with \
continuation
' | sed ': testcont; /\\$/{ =; N; b testcont }'
PASS: sed /$_in_regex/ should not match newlines, only end-of-line
======================
echo -ne '' >input
echo -ne 'aa\n' | sed -e 's/a/b/2; s/a/c/g'
PASS: sed s///NUM test
======================
echo -ne '' >input
echo -ne '1\n2\n3\n4\n5\n' | sed /^2/,2{d}
PASS: sed /regex/,N{...} addresses work
======================
echo -ne '' >input
echo -ne '1\n2\n3\n4\n5\n' | sed /^2/,+2{d}
PASS: sed /regex/,+N{...} addresses work
======================
echo -ne '' >input
echo -ne 'a\n1\nc\nc\na\n2\na\n3\n' | sed -n '/a/,+1 p'
PASS: sed /regex/,+N{...} addresses work 2
======================
echo -ne '1\n2\n3\n4\n5\n6\n7\n8\n' >input
echo -ne '1\n2\n4\n5\n6\n7\n8\n' | cat - >input2; sed /^4/,+2{d} -i input input2; echo $?; cat input input2; rm input2
PASS: sed /regex/,+N{...} -i works
======================
echo -ne '1\n2\n3\n4\n5\n6\n7\n8\n' >input
echo -ne '1\n2\n4\n5\n6\n7\n8\n' | cat - >input2; sed /^4/,+0{d} -i input input2; echo $?; cat input input2; rm input2
PASS: sed /regex/,+0{...} -i works
======================
echo -ne '1\n2\n3\n4\n5\n6\n7\n8\n' >input
echo -ne '1\n2\n4\n5\n6\n7\n8\n' | cat - >input2; sed /^4/,+0d -i input input2; echo $?; cat input input2; rm input2
PASS: sed /regex/,+0<cmd> -i works
======================
echo -ne '' >input
echo -ne '123\nqwe\nasd\n' | sed 's/qwe/ZZZ/wz'; cat z; rm z
PASS: sed 's///w FILE'
======================
echo -ne '' >input
echo -ne 'q\nw\ne\nr\n' | sed '/w/p;//q'
PASS: sed uses previous regexp
======================
echo -ne '' >input
echo -ne 'abca\n' | sed -e 's/^a\|b//g'
PASS: sed ^ OR not^
======================
echo -ne '' >input
echo -ne 'a\nb\nc\n' | sed -n -e '/a/w sed.output' -e '/c/w sed.output' 2>&1 && cat sed.output && rm sed.output
PASS: sed understands duplicate file name
======================
echo -ne '' >input
echo -ne '' | seq 2> /dev/null || echo yes
PASS: seq (exit with error)
======================
echo -ne '' >input
echo -ne '' | seq 1 2 3 4 2> /dev/null || echo yes
PASS: seq (exit with error)
======================
echo -ne '' >input
echo -ne '' | seq 3
PASS: seq one argument
======================
echo -ne '' >input
echo -ne '' | seq 5 7
PASS: seq two arguments
======================
echo -ne '' >input
echo -ne '' | seq 7 5
PASS: seq two arguments reversed
======================
echo -ne '' >input
echo -ne '' | seq 3 3
PASS: seq two arguments equal
======================
echo -ne '' >input
echo -ne '' | seq 1 -15 1
PASS: seq two arguments equal, arbitrary negative step
======================
echo -ne '' >input
echo -ne '' | seq 1 +15 1
PASS: seq two arguments equal, arbitrary positive step
======================
echo -ne '' >input
echo -ne '' | seq 4 2 8
PASS: seq count up by 2
======================
echo -ne '' >input
echo -ne '' | seq 8 -2 4
PASS: seq count down by 2
======================
echo -ne '' >input
echo -ne '' | seq 4 -2 8
PASS: seq count wrong way #1
======================
echo -ne '' >input
echo -ne '' | seq 8 2 4
PASS: seq count wrong way #2
======================
echo -ne '' >input
echo -ne '' | seq 3 .3 4
PASS: seq count by .3
======================
echo -ne '' >input
echo -ne '' | seq 3 .30 4
PASS: seq count by .30
======================
echo -ne '' >input
echo -ne '' | seq 3 .30 4.000
PASS: seq count by .30 to 4.000
======================
echo -ne '' >input
echo -ne '' | seq .7 -.9 -2.2
PASS: seq count by -.9
======================
echo -ne '' >input
echo -ne '' | seq 4 0 8 | head -n 10
PASS: seq count by zero
======================
echo -ne '' >input
echo -ne '' | seq -w 003
PASS: seq one argument with padding
======================
echo -ne '' >input
echo -ne '' | seq -w 005 7
PASS: seq two arguments with padding
======================
echo -ne '' >input
echo -ne '' | seq -w 8 -3 04
PASS: seq count down by 3 with padding
======================
echo -ne '' >input
echo -ne '' | seq -w 09 .3 11
PASS: seq count by .3 with padding 1
======================
echo -ne '' >input
echo -ne '' | seq -w 03 .3 0004
PASS: seq count by .3 with padding 2
======================
echo -ne '' >input
echo -ne '' | echo "da39a3ee5e6b4b0d3255bfef95601890afd80709 EMPTY" | sha1sum -c
PASS: sha1sum: one-space separated input for -c
SKIP: sha1sum
SKIP: sha256sum
======================
echo -ne 'c\na\nb\n' >input
echo -ne '' | sort input
PASS: sort
======================
echo -ne '3\n1\n010\n' >input
echo -ne '' | sort input
PASS: sort #2
======================
echo -ne '' >input
echo -ne 'b\na\nc\n' | sort
PASS: sort stdin
======================
echo -ne '3\n1\n010\n' >input
echo -ne '' | sort -n input
PASS: sort numeric
======================
echo -ne 'point\nwook\npabst\naargh\nwalrus\n' >input
echo -ne '' | sort -r input
PASS: sort reverse
======================
echo -ne '42	1	3	woot
42	1	010	zoology
egg	1	2	papyrus
7	3	42	soup
999	3	0	algebra
' >input
echo -ne '' | sort -k4,4 input
PASS: sort one key
======================
echo -ne '42	1	3	woot
42	1	010	zoology
egg	1	2	papyrus
7	3	42	soup
999	3	0	algebra
' >input
echo -ne '' | sort -k2,3n input
PASS: sort key range with numeric option
======================
echo -ne '42	1	3	woot
42	1	010	zoology
egg	1	2	papyrus
7	3	42	soup
999	3	0	algebra
' >input
echo -ne '' | sort -k2,3n -r input
PASS: sort key range with numeric option and global reverse
======================
echo -ne '42	1	3	woot
42	1	010	zoology
egg	1	2	papyrus
7	3	42	soup
999	3	0	algebra
' >input
echo -ne '' | sort -k2,3rn input
PASS: sort key range with multiple options
======================
echo -ne 'c 3
b 2
d 2
' >input
echo -ne '' | sort -k 2,2n -k 1,1r input
PASS: sort key range with two -k options
======================
echo -ne '/a/2
/b/1
' >input
echo -ne '' | sort -n -k2 -t/ input
PASS: sort with non-default leading delim 1
======================
echo -ne '/b/1
/a/2
' >input
echo -ne '' | sort -n -k3 -t/ input
PASS: sort with non-default leading delim 2
======================
echo -ne '//a/2
//b/1
' >input
echo -ne '' | sort -n -k3 -t/ input
PASS: sort with non-default leading delim 3
======================
echo -ne 'a/a:a
a:b
' >input
echo -ne '' | sort -t: -k1,1 input
PASS: sort with non-default leading delim 4
======================
echo -ne 'aa.2
ab.1
' >input
echo -ne '' | sort -t. -k1,1.1 -k2 input
PASS: sort with ENDCHAR
======================
echo -ne 'GLIBC_2.21
GLIBC_2.1.1
GLIBC_2.2.1
GLIBC_2.2
GLIBC_2.20
GLIBC_2.10
GLIBC_2.1
' >input
echo -ne '' | sort -t. -k 1,1 -k 2n,2n -k 3 input
PASS: glibc build sort
======================
echo -ne 'GLIBC_2.10
GLIBC_2.2.1
GLIBC_2.1.1
GLIBC_2.20
GLIBC_2.2
GLIBC_2.1
GLIBC_2.21
' >input
echo -ne '' | sort -u -t. -k 1,1 -k 2n,2n -k 3 input
PASS: glibc build sort unique
======================
echo -ne 'a c
b c
' >input
echo -ne '' | sort -u -k2 input
PASS: sort -u should consider field only when discarding
======================
echo -ne 'one\0two\0three\0' >input
echo -ne '' | sort -z input
PASS: sort -z outputs NUL terminated lines
======================
echo -ne '' >input
echo -ne ' 2 \n 1 \n a \n' | sort -n -k2 -t ' '
PASS: sort key doesn't strip leading blanks, disables fallback global sort
======================
echo -ne '222
111
' >input
echo -ne '' | sort -o input input && cat input
PASS: sort file in place
======================
echo -ne 'a 1
b 2
c 1
d 2
' >input
echo -ne '' | sort -k2 -r -s input
PASS: sort -sr (stable and reverse) does NOT reverse 'stable' ordering
======================
echo -ne '1Y
5y
1M
2E
3k
3e
2K
4m
1023
1025
3000
1024
' >input
echo -ne '' | sort -h input
PASS: sort -h
======================
echo -ne '2 April
1  May
3 March
' >input
echo -ne '' | sort -k2,2M input
PASS: sort -k2,2M
======================
echo -ne 'z b
a b
z a
a a' >input
echo -ne '' | sort -s -u -k 2 input
PASS: sort -s -u
======================
echo -ne '' >input
echo -ne '' | start-stop-daemon -S -x true 2>&1; echo $?
PASS: start-stop-daemon -x without -a
======================
echo -ne '' >input
echo -ne '' | start-stop-daemon -S -a false 2>&1; echo $?
PASS: start-stop-daemon -a without -x
======================
echo -ne '' >input
echo -ne '' | start-stop-daemon -S false 2>&1; echo $?
PASS: start-stop-daemon without -x and -a
SKIP: start-stop-daemon with both -x and -a (need non-busybox false)
PASS: strings-works-like-GNU
PASS: tail-n-works
SKIP: tail-works
======================
echo -ne '' >input
echo -ne 'qw' | tail -c +55 2>&1; echo $?
PASS: tail: +N with N > file length
======================
echo -ne '' >input
echo -ne '' | 
	dd if=/dev/zero bs=16k count=1 2>/dev/null | tail -c +8200 | wc -c;
	dd if=/dev/zero bs=16k count=1 2>/dev/null | tail -c +8208 | wc -c;
	
PASS: tail: -c +N with largish N
PASS: tar-archives-multiple-files
PASS: tar-complains-about-missing-file
PASS: tar-demands-at-least-one-ctx
PASS: tar-demands-at-most-one-ctx
PASS: tar-extracts-all-subdirs
PASS: tar-extracts-file
PASS: tar-extracts-from-standard-input
PASS: tar-extracts-multiple-files
PASS: tar-extracts-to-standard-output
PASS: tar-handles-cz-options
PASS: tar-handles-empty-include-and-non-empty-exclude-list
PASS: tar-handles-exclude-and-extract-lists
PASS: tar-handles-multiple-X-options
PASS: tar-handles-nested-exclude
SKIP: tar_with_link_with_size
SKIP: tar_with_prefix_fields
======================
echo -ne '' >input
echo -ne '' | \
tar xvf - 2>&1; echo $?

PASS: tar Empty file is not a tarball
======================
echo -ne '' >input
echo -ne '' | \
{ tar xvzf - 2>&1; echo $?; } | grep -Fv "invalid magic"

PASS: tar Empty file is not a tarball.tar.gz
======================
echo -ne '' >input
echo -ne '' | \
dd if=/dev/zero bs=512 count=2 2>/dev/null | tar xvf - 2>&1; echo $?

PASS: tar Two zeroed blocks is a ('truncated') empty tarball
======================
echo -ne '' >input
echo -ne '' | \
dd if=/dev/zero bs=512 count=20 2>/dev/null | tar xvf - 2>&1; echo $?

PASS: tar Twenty zeroed blocks is an empty tarball
======================
echo -ne '' >input
echo -ne '' | \
>input_hard1
ln input_hard1 input_hard2
mkdir input_dir
>input_dir/file
chmod -R 644 *
chmod    755 input_dir
tar cf test.tar input input_dir/ input_hard1 input_hard2 input_hard1 input_dir/ input
tar tvf test.tar | sed "s/.*[0-9] input/input/"
rm -rf input_dir
tar xf test.tar 2>&1
echo Ok: $?
ls -l . input_dir/* | grep input_ | sed "s/\\(^[^ ]*\\) .* input/\\1 input/"

PASS: tar hardlinks and repeated files
======================
echo -ne '' >input
echo -ne '' | \
>input_hard1
chmod 741 input_hard1
ln input_hard1 input_hard2
mkdir input_dir
ln input_hard1 input_dir
ln input_hard2 input_dir
chmod 550 input_dir
# On some filesystems, input_dir/input_hard2 is returned by readdir
# BEFORE input_dir/input_hard1! Thats why we cant just "tar cf ... input_*":
tar cf test.tar input_dir/input_hard* input_hard*
tar tvf test.tar | sed "s/.*[0-9] input/input/"
chmod 770 input_dir
rm -rf input_*
tar xf test.tar 2>&1
echo Ok: $?
ls -l . input_dir/* | grep "input.*hard" | sed "s/\\(^[^ ]*\\) .* input/\\1 input/"

PASS: tar hardlinks mode
======================
echo -ne '' >input
echo -ne '' | \
>input_file
chmod 741 input_file
ln -s input_file input_soft
mkdir input_dir
ln input_file input_dir
ln input_soft input_dir
chmod 550 input_dir
tar cf test.tar input_dir/* input_[fs]*
tar tvf test.tar | sed "s/.*[0-9] input/input/" | sort
chmod 770 input_dir
rm -rf input_*
tar xf test.tar 2>&1
echo Ok: $?
ls -l . input_dir/* | grep "input_[fs]" | sed "s/\\(^[^ ]*\\) .* input/\\1 input/"

PASS: tar symlinks mode
======================
echo -ne 'Ok\n' >input
echo -ne '' | ln input input_hard
tar cf test.tar input_hard
echo WRONG >input
# --overwrite opens 'input_hard' without unlinking,
# thus 'input_hard' still linked to 'input' and we write 'Ok' into it
tar xf test.tar --overwrite 2>&1 && cat input

PASS: tar --overwrite
======================
echo -ne '' >input
echo -ne '' | dd count=1 bs=1M if=/dev/zero of=F0 2>/dev/null
tar -czf F0.tgz F0
rm F0
tar -xzvf F0.tgz && echo Ok
rm F0 || echo BAD

PASS: tar extract tgz
SKIP: tar extract txz
======================
echo -ne '' >input
echo -ne '' | rm -rf input_* test.tar 2>/dev/null
mkdir input_dir
echo Ok >input_dir/file
tar cf test.tar ./../tar.tempdir/input_dir/../input_dir 2>&1
rm -rf input_* 2>/dev/null
tar -vxf test.tar 2>&1
cat input_dir/file 2>&1

PASS: tar strips /../ on extract
SKIP: tar does not extract into symlinks
SKIP: tar -k does not extract into symlinks
======================
echo -ne '' >input
echo -ne '' | \
tar xvf ../tar.utf8.tar.bz2 2>&1; echo $?
export LANG=en_US.UTF-8
ls -l etc/ssl/certs/* | sed "s:.*etc/:etc/:" | sort
unset LANG
rm -rf etc usr

PASS: tar Pax-encoded UTF8 names and symlinks
SKIP: tar Symlink attack: create symlink and then write through it
======================
echo -ne '' >input
echo -ne '' | \
mkdir dir
>dir/a
ln -s ../dir/a dir/b
ln dir/b dir/c
mkdir new
tar cf - dir/* | tar -C new -xvf - 2>&1

PASS: tar Symlinks and hardlinks coexist
PASS: tee-appends-input
PASS: tee-tees-input
======================
echo -ne '' >input
echo -ne '' | busybox test; echo $?
PASS: test: should be false (1)
======================
echo -ne '' >input
echo -ne '' | busybox test ''; echo $?
PASS: test '': should be false (1)
======================
echo -ne '' >input
echo -ne '' | busybox test !; echo $?
PASS: test !: should be true (0)
======================
echo -ne '' >input
echo -ne '' | busybox test a; echo $?
PASS: test a: should be true (0)
======================
echo -ne '' >input
echo -ne '' | busybox test --help; echo $?
PASS: test --help: should be true (0)
======================
echo -ne '' >input
echo -ne '' | busybox test -f; echo $?
PASS: test -f: should be true (0)
======================
echo -ne '' >input
echo -ne '' | busybox test ! -f; echo $?
PASS: test ! -f: should be false (1)
======================
echo -ne '' >input
echo -ne '' | busybox test a = a; echo $?
PASS: test a = a: should be true (0)
======================
echo -ne '' >input
echo -ne '' | busybox test -lt = -gt; echo $?
PASS: test -lt = -gt: should be false (1)
======================
echo -ne '' >input
echo -ne '' | busybox test a -a !; echo $?
PASS: test a -a !: should be true (0)
======================
echo -ne '' >input
echo -ne '' | busybox test -f = a -o b; echo $?
PASS: test -f = a -o b: should be true (0)
======================
echo -ne '' >input
echo -ne '' | busybox test ! a = b -a ! c = c; echo $?
PASS: test ! a = b -a ! c = c: should be false (1)
======================
echo -ne '' >input
echo -ne '' | busybox test ! a = b -a ! c = d; echo $?
PASS: test ! a = b -a ! c = d: should be true (0)
======================
echo -ne '' >input
echo -ne '' | busybox test '!' = '!'; echo $?
PASS: test '!' = '!': should be true (0)
======================
echo -ne '' >input
echo -ne '' | busybox test '(' = '('; echo $?
PASS: test '(' = '(': should be true (0)
======================
echo -ne '' >input
echo -ne '' | busybox test '!' '!' = '!'; echo $?
PASS: test '!' '!' = '!': should be false (1)
======================
echo -ne '' >input
echo -ne '' | busybox test '!' '(' = '('; echo $?
PASS: test '!' '(' = '(': should be false (1)
PASS: touch-creates-file
PASS: touch-does-not-create-file
PASS: touch-touches-files-after-non-existent-file
PASS: tr-d-alnum-works
PASS: tr-d-works
PASS: tr-non-gnu
PASS: tr-rejects-wrong-class
PASS: tr-works
======================
echo -ne '' >input
echo -ne '[qwe]' | tr '[q-z]' '_Q-Z+'
PASS: tr does not treat [] in [a-z] as special
======================
echo -ne '' >input
echo -ne '19AFH\n' | tr -cd '[0-9A-F]'
PASS: tr understands 0-9A-F
======================
echo -ne '' >input
echo -ne '19AFH\n' | tr -cd '[:xdigit:]'
PASS: tr understands [:xdigit:]
======================
echo -ne '' >input
echo -ne '789abcxyz\n' | tr '[:digit:]y-z' 111111111123
PASS: tr does not stop after [:digit:]
======================
echo -ne '' >input
echo -ne '#0123456789ABCDEFGabcdefg\n' | tr '[:xdigit:]Gg' 1111111151242222333330xX
PASS: tr has correct xdigit sequence
PASS: true-is-silent
PASS: true-returns-success
======================
echo -ne '' >input
echo -ne '' | uniq nonexistent 2> /dev/null || echo yes
PASS: uniq (exit with error)
======================
echo -ne '' >input
echo -ne '' | uniq /dev/null && echo yes
PASS: uniq (exit success)
======================
echo -ne '' >input
echo -ne 'one\ntwo\ntwo\nthree\nthree\nthree\n' | uniq
PASS: uniq (default to stdin)
======================
echo -ne '' >input
echo -ne 'one\ntwo\ntwo\nthree\nthree\nthree\n' | uniq -
PASS: uniq - (specify stdin)
======================
echo -ne 'one\ntwo\ntwo\nthree\nthree\nthree\n' >input
echo -ne '' | uniq input
PASS: uniq input (specify file)
======================
echo -ne 'one\ntwo\ntwo\nthree\nthree\nthree\n' >input
echo -ne '' | uniq input actual > /dev/null
PASS: uniq input outfile (two files)
======================
echo -ne '' >input
echo -ne 'one\ntwo\ntwo\nthree\nthree\nthree\n' | uniq - actual
PASS: uniq (stdin) outfile
======================
echo -ne 'one\ntwo\ntwo\nthree\nthree\nthree\n' >input
echo -ne '' | uniq input -
PASS: uniq input - (specify stdout)
======================
echo -ne '' >input
echo -ne 'one\ntwo\ntwo\nthree\nthree\nthree\n' | uniq -c | sed 's/^[ \t]*//'
PASS: uniq -c (occurrence count)
======================
echo -ne '' >input
echo -ne 'one\ntwo\ntwo\nthree\nthree\nthree\n' | uniq -d
PASS: uniq -d (dups only)
======================
echo -ne '' >input
echo -ne 'cc	dd	ee8
bb	cc	dd8
aa	bb	cc9
' | uniq -f2 -s 3
PASS: uniq -f -s (skip fields and chars)
======================
echo -ne '' >input
echo -ne 'cc1
cc2
cc3
' | uniq -w 2
PASS: uniq -w (compare max characters)
======================
echo -ne '' >input
echo -ne 'aaccaa
aaccbb
bbccaa
' | uniq -s 2 -w 2
PASS: uniq -s -w (skip fields and compare max chars)
======================
echo -ne '' >input
echo -ne 'one\ntwo\ntwo\nthree\nthree\nthree\n' | uniq -d -u
PASS: uniq -u and -d produce no output
======================
echo -ne '' >input
echo -ne '' | unzip -q foo.zip foo/ && test -d foo && test ! -f foo/bar && echo yes
PASS: unzip (subdir only)
SKIP: unzip (bad archive)
SKIP: unzip (archive with corrupted lzma 1)
SKIP: unzip (archive with corrupted lzma 2)
PASS: uptime-works
PASS: wc-counts-all
PASS: wc-counts-characters
PASS: wc-counts-lines
PASS: wc-counts-words
PASS: wc-prints-longest-line-length
PASS: which-uses-default-path
SKIP: xargs-works
======================
echo -ne '' >input
echo -ne 'a\n_\nb\n' | xargs -E _
PASS: xargs -E _ stops on underscore
======================
echo -ne '' >input
echo -ne 'a\n_\nb\n' | xargs -E ''
PASS: xargs -E ''
======================
echo -ne '' >input
echo -ne 'a\n_\nb\n' | xargs -e
PASS: xargs -e without param
======================
echo -ne '' >input
echo -ne 'a\n_\nb\n' | xargs
PASS: xargs does not stop on underscore ('new' GNU behavior)
======================
echo -ne '' >input
echo -ne 'a\n' | xargs -s7 echo
PASS: xargs -s7 can take one-char input
======================
echo -ne '' >input
echo -ne '1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 00\n' | xargs -ts25 echo 2>&1 >/dev/null
PASS: xargs -sNUM test 1
======================
echo -ne '' >input
echo -ne '2 3 4 5 6 7 8 9 0 2 3 4 5 6 7 8 9 00\n' | xargs -ts25 echo 1 2>&1 >/dev/null
PASS: xargs -sNUM test 2
SKIP: xargs argument line too long
SKIP: xargs -n1
SKIP: xargs -n2
SKIP: xargs -I skips empty lines and leading whitespace
DURATION: 6