File: test.out

package info (click to toggle)
runawk 1.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 712 kB
  • sloc: awk: 1,127; ansic: 736; sh: 420; makefile: 103
file content (1364 lines) | stat: -rw-r--r-- 33,002 bytes parent folder | download | duplicates (2)
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
--------------------------------------------------
 ------ args: -d _test_program
new_argv [0] = _test_program
new_argv [1] = -f
new_argv [3] = --
--------------------------------------------------
 ------ args: -d _test_program --long-option
new_argv [0] = _test_program
new_argv [1] = -f
new_argv [3] = --
new_argv [4] = --long-option
--------------------------------------------------
 ------ args: -d _test_program -o=file
new_argv [0] = _test_program
new_argv [1] = -f
new_argv [3] = --
new_argv [4] = -o=file
--------------------------------------------------
 ------ args: -d _test_program fn1 fn2
new_argv [0] = _test_program
new_argv [1] = -f
new_argv [3] = --
new_argv [4] = fn1
new_argv [5] = fn2
--------------------------------------------------
 ------ args: -d -f abs.awk -e BEGIN {print abs(-123), abs(234); exit}
new_argv [0] = awk
new_argv [1] = -f
new_argv [2] = /ROOT/../modules/abs.awk
new_argv [3] = -f
new_argv [4] = /tmp/runawk.NNNNNN
new_argv [5] = --
--------------------------------------------------
 ------ args: -d -f alt_assert.awk -e BEGIN {exit}
new_argv [0] = awk
new_argv [1] = -f
new_argv [2] = /ROOT/../modules/exitnow.awk
new_argv [3] = -f
new_argv [4] = /ROOT/../modules/abort.awk
new_argv [5] = -f
new_argv [6] = /ROOT/../modules/alt_assert.awk
new_argv [7] = -f
new_argv [8] = /tmp/runawk.NNNNNN
new_argv [9] = --
--------------------------------------------------
 ------ args: -V
xxx
--------------------------------------------------
 ------ args: -h
runawk - wrapper for an AWK interpreter
--------------------------------------------------
 ------ args: -e BEGIN {print "Hello World"}
Hello World
--------------------------------------------------
 ------ args: -v one=1 -e BEGIN {print one} {print "unbelievably"} /dev/null
1
--------------------------------------------------
 ------ args: -v two=2 -e BEGIN {print two}
2
--------------------------------------------------
 ------ args: -e BEGIN {print "Hello World"} /dev/null
Hello World
--------------------------------------------------
 ------ args: -v var1=123 -v var2=321 -e BEGIN {print var1, var2}
123 321
--------------------------------------------------
 ------ args: _test.tmp
Hello World1.2
Hello World1.3
Hello World1.1
Hello World 2.2
Hello World 2.1
Hello World 2.3
--------------------------------------------------
 ------ args: _test.tmp
Cannot find module `module2.1.awk`, check AWKPATH environment variable
--------------------------------------------------
 ------ args: /ROOT/mods1/test_modinfo
Hello World1.2
Hello World1.3
Hello World1.1
Hello World 2.2
Hello World 2.1
Hello World 2.3
MODC=8
MODV [0]=/ROOT/mods1/module1.2.awk
MODV [1]=/ROOT/mods1/module1.3.awk
MODV [2]=/ROOT/mods1/module1.1.awk
MODV [3]=/ROOT/mods2/module2.2.awk
MODV [4]=/ROOT/mods2/module2.1.awk
MODV [5]=/ROOT/mods2/module2.3.awk
MODV [6]=/ROOT/../modules/modinfo.awk
MODV [7]=/ROOT/mods1/test_modinfo
MODMAIN=/ROOT/mods1/test_modinfo
--------------------------------------------------
 ------ args: /ROOT/mods3/failed1.awk
error: invalid directive at line #1,
 line=`#use `
 file=`/ROOT/mods3/failed1.awk`
--------------------------------------------------
 ------ args: /ROOT/mods3/failed2.awk
error: invalid directive at line #2,
 line=`#interp      "trtrtr`
 file=`/ROOT/mods3/failed2.awk`
--------------------------------------------------
 ------ args: /ROOT/mods3/failed3.awk
error: invalid directive at line #3,
 line=`#env 'LC_ALL=C'                   `
 file=`/ROOT/mods3/failed3.awk`
--------------------------------------------------
 ------ args: /ROOT/mods3/failed4.awk
running '/invalid/path' failed: No such file or directory
--------------------------------------------------
 ------ args: /ROOT/mods3/test5.awk
1
0
1
0
env FOO=BAR
env TESTVAR=testval
--------------------------------------------------
 ------ args: -e 
#interp "/invalid/path"

BEGIN {print "Hello World!"}

running '/invalid/path' failed: No such file or directory
--------------------------------------------------
 ------ args: #interp-var directive
123
running '/invalid/path' failed
--------------------------------------------------
 ------ args: #safe-use directive
--- #safe-use test: ---
new_argv [0] = awk
new_argv [1] = -f
new_argv [2] = /path/temp1.awk
new_argv [3] = -f
new_argv [4] = /tmp/runawk.NNNNNN
new_argv [5] = --
--- #safe-use test: ---
new_argv [0] = awk
new_argv [1] = -f
new_argv [2] = /path/temp1.awk
new_argv [3] = -f
new_argv [4] = /tmp/runawk.NNNNNN
new_argv [5] = --
--- #safe-use test: ---
new_argv [0] = awk
new_argv [1] = -f
new_argv [2] = /path/temp2.awk
new_argv [3] = -f
new_argv [4] = /tmp/runawk.NNNNNN
new_argv [5] = --
--- #safe-use test: ---
new_argv [0] = awk
new_argv [1] = 
#safe-use "/bad/path3" "/bad/path2" "/bad/path1"

BEGIN {
   print 123
   exit 0
}

--------------------------------------------------
 ------ args: -e 
#use "/invalid/path/file.awk"

stat("/invalid/path/file.awk") failed: No such file or directory
--------------------------------------------------
 ------ args: -d -e 
BEGIN {
   for (i=0; i < ARGC; ++i){
      printf "ARGV [%s]=%s\n", i, ARGV [i]
   }
} -- -a -b -c
new_argv [0] = awk
new_argv [1] = 
BEGIN {
   for (i=0; i < ARGC; ++i){
      printf "ARGV [%s]=%s\n", i, ARGV [i]
   }
}
new_argv [2] = -a
new_argv [3] = -b
new_argv [4] = -c
--------------------------------------------------
 ------ args: -e 
BEGIN {
   for (i=1; i < ARGC; ++i){
      printf "ARGV [%s]=%s\n", i, ARGV [i]
   }
} -- file1 file2 file3
ARGV [1]=file1
ARGV [2]=file2
ARGV [3]=file3
--------------------------------------------------
 ------ args: -d -e 
#env "LC_ALL=C"
#env "FOO2=bar2"

BEGIN {
   ...
}
new_argv [0] = awk
new_argv [1] = 
#env "LC_ALL=C"
#env "FOO2=bar2"

BEGIN {
   ...
}
--------------------------------------------------
 ------ args: -e 
#env "LC_ALL=C"
#env "FOO2=bar2"

BEGIN {
   print ("y" ~ /^[a-z]$/)
   print ("Y" ~ /^[a-z]$/)
   print ("z" ~ /^[a-z]$/)
   print ("Z" ~ /^[a-z]$/)

   print ("env FOO2=" ENVIRON ["FOO2"])
}

1
0
1
0
env FOO2=bar2
--------------------------------------------------
 ------ args: -e BEGIN {print 1} -e BEGIN {print 2}
multiple -e are not allowed
--------------------------------------------------
 ------ args: -d -e 
    #use "alt_assert.awk"

    BEGIN {
        print "Hello world!"
        abort("just a test", 7)
    }
     /dev/null
new_argv [0] = awk
new_argv [1] = -f
new_argv [2] = /ROOT/../modules/exitnow.awk
new_argv [3] = -f
new_argv [4] = /ROOT/../modules/abort.awk
new_argv [5] = -f
new_argv [6] = /ROOT/../modules/alt_assert.awk
new_argv [7] = -f
new_argv [8] = /tmp/runawk.NNNNNN
new_argv [9] = --
new_argv [10] = /dev/null
--------------------------------------------------
 ------ args: -e 
    #use "alt_assert.awk"

    BEGIN {
        abort("just a test", 7)
    }
    
error: just a test
       ARGV[0]=awk
       $0=``
       NF=0
       FNR=0
       FILENAME=
--------------------------------------------------
 ------ args: -f abs.awk -e BEGIN {print abs(-123), abs(234); exit}
123 234
--------------------------------------------------
 ------ args: -f alt_assert.awk -e BEGIN {assert(0, "Hello assert!")}
error: assertion failed: Hello assert!
       ARGV[0]=awk
       $0=``
       NF=0
       FNR=0
       FILENAME=
--------------------------------------------------
 ------ args: -Te 
    {
       for (i=1; i <= NF; ++i){
          printf "$%d=%s\n", i, $i
       }
    }
$1=   a b c   
$1=a
$2= b 
$3=c 
--------------------------------------------------
 ------ args: ../examples/demo_multisub
--------------------------------------------------
 ------ args: ../examples/demo_tokenre ../examples/demo_tokenre.in
NF=5
$1=wn:
$2=UNIX
$3="UNIX guru"
$4="UNIX operating system"
$5="UNIX system"
NF=4
$1=jargon:
$2=Unix
$3="Unix brain damage"
$4="Unix conspiracy"
NF=1
$1="Unix weenie"
NF=4
$1=foldoc:
$2="berkeley unix"
$3="bsd unix"
$4="call unix"
NF=3
$1="united kingdom unix users group"
$2=unix
$3="unix box"
NF=3
$1="unix brain damage"
$2="unix conspiracy"
$3="unix international"
NF=3
$1="unix man page"
$2="unix manual page"
$3="unix system v"
NF=4
$1="unix to unix copy"
$2="unix weenie"
$3="unix wizard"
$4="usg unix"
--------------------------------------------------
 ------ args: ../examples/demo_tokenre2 ../examples/demo_tokenre2.in
a
:=
1
<NL>
b
:=
2.3
<NL>
<NL>
while
a
+
b
<
10
do
<NL>
a
:=
a
+
1
<NL>
end
<NL>
<NL>
print
'Hello world!'
<NL>
print
'a = '
..
a
<NL>
print
'b = '
..
b
<NL>
--------------------------------------------------
 ------ args: ../examples/demo_tokenre3 ../examples/demo_tokenre3.in
http://sourceforge.net/projects
http://freshmeat.net/projects
dict://dictd.xdsl.by/
vle@gmx.net
faith@dict.org
fake@domain.com
foo@bar.baz.ru
--------------------------------------------------
 ------ args: ../examples/demo_tokenre4 ../examples/demo_tokenre3.in
http://sourceforge.net/projects
http://freshmeat.net/projects
dict://dictd.xdsl.by/
vle@gmx.net
faith@dict.org
fake@domain.com foo@bar.baz.ru
--------------------------------------------------
 ------ args: ../examples/demo_splitre ../examples/demo_tokenre2.in
a
:=
1
<NL>
b
:=
2.3
<NL>
<NL>
while
a
+
b
<
10
do
<NL>
a
:=
a
+
1
<NL>
end
<NL>
<NL>
print
'Hello world!'
<NL>
print
'a = '
..
a
<NL>
print
'b = '
..
b
<NL>
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt -h -
option `h'
ARGV [2] = -
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt --help
option `h'
ARGV [1] = -
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt -h --help -v --verbose -V -o 123 -o234
option `h'
option `h'
option `v'
option `v'
option `V'
option `o': 123
option `o': 234
ARGV [1] = -
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt --output 123 --output 234 -n 999 -n9999 --len 5 --fake /dev/null
option `o': 123
option `o': 234
option `n': 999
option `n': 9999
option `len': 5
option `fake'
ARGV [11] = /dev/null
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt -hVv -- -1 -2 -3
option `h'
option `V'
option `v'
ARGV [3] = -1
ARGV [4] = -2
ARGV [5] = -3
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt --fake -v -- -1 -2 -3
option `fake'
option `v'
ARGV [4] = -1
ARGV [5] = -2
ARGV [6] = -3
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt - -1 -2 -3
ARGV [1] = -
ARGV [2] = -1
ARGV [3] = -2
ARGV [4] = -3
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt --fake -v - -1 -2 -3
option `fake'
option `v'
ARGV [3] = -
ARGV [4] = -1
ARGV [5] = -2
ARGV [6] = -3
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt -1 -2 -3
Unknown option `-1'
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt -hvV
option `h'
option `v'
option `V'
ARGV [1] = -
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt -ho 123
option `h'
option `o': 123
ARGV [1] = -
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt -hoV 123
option `h'
option `o': V
ARGV [2] = 123
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt --unknown
Unknown option `--unknown'
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt --output=file.out -nNNN --len=LENGTH
option `o': file.out
option `n': NNN
option `len': LENGTH
ARGV [1] = -
--------------------------------------------------
 ------ args: ../examples/demo_alt_getopt --output --file--
option `o': --file--
ARGV [1] = -
--------------------------------------------------
 ------ args: ../examples/demo_modinfo
A number of modules: 9
MODV [0]=/ROOT/../modules/abs.awk
MODV [1]=/ROOT/../modules/exitnow.awk
MODV [2]=/ROOT/../modules/abort.awk
MODV [3]=/ROOT/../modules/alt_assert.awk
MODV [4]=/ROOT/../modules/min.awk
MODV [5]=/ROOT/../modules/max.awk
MODV [6]=/ROOT/../modules/alt_getopt.awk
MODV [7]=/ROOT/../modules/modinfo.awk
MODV [8]=/ROOT/../examples/demo_modinfo
program name: /ROOT/../examples/demo_modinfo
--------------------------------------------------
 ------ args: ../examples/demo_has_suffix ../examples/demo_has_suffix.in
no, `mama' does not end with `mamam'
yes, `mama' ends with `mama'
no, `mama' does not end with `mam'
yes, `mama' ends with `ma'
yes, `mama' ends with `a'
yes, `mama' ends with `'
yes, `file.txt' ends with `.txt'
no, `file.txt' does not end with `.log'
no, `file.txt' does not end with `.bmp'
yes, `file.txt' ends with `file.txt'
--------------------------------------------------
 ------ args: ../examples/demo_has_prefix ../examples/demo_has_prefix.in
no, `mama' does not begin with `mamam'
yes, `mama' begins with `mama'
yes, `mama' begins with `mam'
yes, `mama' begins with `ma'
no, `mama' does not begin with `a'
yes, `mama' begins with `'
no, `file.txt' does not begin with `.txt'
no, `file.txt' does not begin with `.log'
yes, `file.txt' begins with `file.'
yes, `file.txt' begins with `file'
no, `file.txt' does not begin with `bzzzzzzzzzzzzz'
--------------------------------------------------
 ------ args: ../examples/demo_dirname
Usage: dirname path
--------------------------------------------------
 ------ args: ../examples/demo_dirname /path/to/file
/path/to
--------------------------------------------------
 ------ args: ../examples/demo_dirname file.txt
.
--------------------------------------------------
 ------ args: ../examples/demo_dirname /
/
--------------------------------------------------
 ------ args: ../examples/demo_dirname /dir/
/
--------------------------------------------------
 ------ args: ../examples/demo_basename
Usage: basename path
--------------------------------------------------
 ------ args: ../examples/demo_basename /path/to/file
file
--------------------------------------------------
 ------ args: ../examples/demo_basename file.txt
file.txt
--------------------------------------------------
 ------ args: ../examples/demo_basename /
/
--------------------------------------------------
 ------ args: ../examples/demo_basename /dir/
dir
--------------------------------------------------
 ------ args: ../examples/demo_basename /path/to/file.txt .txt
file
--------------------------------------------------
 ------ args: ../examples/demo_basename file.txt .txt
file
--------------------------------------------------
 ------ args: ../examples/demo_basename / .txt
/
--------------------------------------------------
 ------ args: ../examples/demo_basename /dir/ .txt
dir
--------------------------------------------------
 ------ args: ../examples/demo_basename /path/to/file.txt .log
file.txt
--------------------------------------------------
 ------ args: ../examples/demo_basename file.txt .log
file.txt
--------------------------------------------------
 ------ args: ../examples/demo_basename / .log
/
--------------------------------------------------
 ------ args: ../examples/demo_basename /dir/ .log
dir
--------------------------------------------------
 ------ args: ../examples/demo_shquote ../examples/demo_shquote.in
''\'''
printf: '
''\'''\'''
printf: ''
''\'''\'''\'''
printf: '''
'\'
printf: \
'\\'
printf: \\
'\\\'
printf: \\\
'\\'\'''
printf: \\'
''\''\'\'''
printf: '\'
''
printf: 
'Apple'\''s'
printf: Apple's
'apple'
printf: apple
'file name.txt'
printf: file name.txt
'*&;<>#~^$`!][(){}?'
printf: *&;<>#~^$`!][(){}?
--------------------------------------------------
 ------ args: ../examples/demo_alt_join
succeeded
--------------------------------------------------
 ------ args: ../examples/demo_readfile
usage: demo_readfile <filename>
--------------------------------------------------
 ------ args: ../examples/demo_readfile ../examples/demo_readfile.in
line1
line2
line3
--------------------------------------------------
 ------ args: ../examples/demo_power_getopt
The following option were applied
f         --- 0
flag      --- 0
long-flag --- 0
s         --- 0
F         --- default1
FLAG      --- default2
LONG-FLAG --- default3
S         --- default4
X         --- 0
Y         --- default5
//////////////////////////////////////////////////
 ------ args: ../examples/demo_power_getopt -ffss --flag --long-flag
--------------------------------------------------
F         --- default1
FLAG      --- default2
LONG-FLAG --- default3
S         --- default4
The following option were applied
X         --- 0
Y         --- default5
f         --- 3
flag      --- 3
long-flag --- 1
options [f]=3
options [long-flag]=1
options [s]=2
s         --- 2
//////////////////////////////////////////////////
      --LONG-FLAG <value>     long flag with value
      --long-flag             long flag only
   -F|--FLAG <value>          flag with value
   -P                         print ARGC and ARGV
   -S <value>                 short flag with value
   -X                         short flag
   -Y <value>                 short flag with value
   -f|--flag                  flag
   -h|--help                  display this screen
   -s                         short flag only
 ------ args: ../examples/demo_power_getopt -h
--------------------------------------------------
OPTIONS:
power_getopt - program demonstrating a power of power_getopt.awk module
usage: power_getopt [OPTIONS]
//////////////////////////////////////////////////
 ------ args: ../examples/demo_power_getopt -f --long-flag -s -F123 --FLAG=234 --LONG-FLAG 345 -S 456
--------------------------------------------------
F         --- 234
FLAG      --- 234
LONG-FLAG --- 345
S         --- 456
The following option were applied
X         --- 0
Y         --- default5
f         --- 1
flag      --- 1
long-flag --- 1
options [F]=234
options [LONG-FLAG]=345
options [S]=456
options [f]=1
options [long-flag]=1
options [s]=1
s         --- 1
//////////////////////////////////////////////////
 ------ args: ../examples/demo_power_getopt -f --long-flag -s -F123 --FLAG=234 --LONG-FLAG 345 -S 456 -P arg1  arg3 arg4 
--------------------------------------------------
ARGC=6
ARGV [1]=arg1
ARGV [2]=
ARGV [3]=arg3
ARGV [4]=arg4
ARGV [5]=
//////////////////////////////////////////////////
--------------------------------------------------
 ------ args: ../examples/demo_power_getopt2 --help
power_getopt - program demonstrating a power of power_getopt.awk module
usage: power_getopt [OPTIONS]
OPTIONS:
   -?|--help                  display this screen
--------------------------------------------------
 ------ args: ../examples/demo_power_getopt2 -?
power_getopt - program demonstrating a power of power_getopt.awk module
usage: power_getopt [OPTIONS]
OPTIONS:
   -?|--help                  display this screen
--------------------------------------------------
 ------ args: ../examples/demo_runcmd
file name.txt
~file&name'foobar'.txt
succeeded
--------------------------------------------------
 ------ args: ../examples/demo_heapsort2
--------------------------------------------------
 ------ args: ../examples/demo_heapsort
AWK
Ada
BCPL
C
C#
C++
Caml
Clean
Cobol
D
ECMAScript
Eiffel
Emacs Lisp
Erlang
F#
Forth
Fortran
Haskell
Java
Lisp
Lua
Miranda
Modula-3
Oberon-2
Objective-C
Oz
PHP
PL/1
Pascal
Perl
Pike
Prolog
REFAL
Rebol
Rexx
Ruby
SML
Scheme
Simula-67
Smalltalk
Snobol
TCL
UNIX shell
csh
ksh
rc
sed
--------------------------------------------------
 ------ args: ../examples/demo_heapsort3
Fortran 1957
Lisp 1958
Cobol 1959
Snobol 1962
PL/1 1964
REFAL 1966
BCPL 1966
Simula-67 1967
Forth 1970
Pascal 1970
C 1972
Prolog 1972
sed 1973
Scheme 1975
AWK 1977
UNIX_shell 1977
csh 1978
Rexx 1979
Modula-3 1980
Smalltalk 1980
ksh 1982
Ada 1983
C++ 1983
Caml 1985
Miranda 1985
Eiffel 1986
Objective-C 1986
Erlang 1986
Perl 1987
Clean 1987
TCL 1988
rc 1989
SML 1990
Haskell 1990
Oberon-2 1991
Oz 1991
Lua 1993
Pike 1994
Ruby 1995
Java 1995
PHP 1995
Rebol 1997
ECMAScript 1997
D 1999
C# 2001
F# 2002
--------------------------------------------------
 ------ args: ../examples/demo_heapsort4
sorted1.1: bilberry cranberry gooseberry raspberry strawberry
sorted1.2: bilberry cranberry gooseberry raspberry strawberry
sorted1.3: gooseberry cranberry bilberry raspberry strawberry
sorted2.1: bilberry cranberry gooseberry raspberry strawberry
sorted2.2: bilberry cranberry gooseberry raspberry strawberry
sorted2.3: 0 0 0 0 0
sorted1.1: Earth Jupiter Moon Saturn Sun Venus
sorted1.2: Earth Jupiter Moon Saturn Sun Venus
sorted1.3: Jupiter Venus Moon Sun Earth Saturn
sorted2.1: Earth Jupiter Moon Saturn Sun Venus
sorted2.2: Earth Jupiter Moon Saturn Sun Venus
sorted2.3: 0 0 0 0 0 0
sorted1.1: 1 2 10 20 100 200
sorted1.2: 1 10 100 2 20 200
sorted1.3: 1 2 10 20 100 200
sorted2.1: 1 2 10 20 100 200
sorted2.2: 1 10 100 2 20 200
sorted2.3: 1 2 10 20 100 200
--------------------------------------------------
 ------ args: ../examples/demo_quicksort2
--------------------------------------------------
 ------ args: ../examples/demo_quicksort
AWK
Ada
BCPL
C
C#
C++
Caml
Clean
Cobol
D
ECMAScript
Eiffel
Emacs Lisp
Erlang
F#
Forth
Fortran
Haskell
Java
Lisp
Lua
Miranda
Modula-3
Oberon-2
Objective-C
Oz
PHP
PL/1
Pascal
Perl
Pike
Prolog
REFAL
Rebol
Rexx
Ruby
SML
Scheme
Simula-67
Smalltalk
Snobol
TCL
UNIX shell
csh
ksh
rc
sed
--------------------------------------------------
 ------ args: ../examples/demo_quicksort3
Fortran 1957
Lisp 1958
Cobol 1959
Snobol 1962
PL/1 1964
REFAL 1966
BCPL 1966
Simula-67 1967
Forth 1970
Pascal 1970
C 1972
Prolog 1972
sed 1973
Scheme 1975
AWK 1977
UNIX_shell 1977
csh 1978
Rexx 1979
Modula-3 1980
Smalltalk 1980
ksh 1982
Ada 1983
C++ 1983
Caml 1985
Miranda 1985
Eiffel 1986
Objective-C 1986
Erlang 1986
Perl 1987
Clean 1987
TCL 1988
rc 1989
SML 1990
Haskell 1990
Oberon-2 1991
Oz 1991
Lua 1993
Pike 1994
Ruby 1995
Java 1995
PHP 1995
Rebol 1997
ECMAScript 1997
D 1999
C# 2001
F# 2002
--------------------------------------------------
 ------ args: ../examples/demo_fieldwidths
NF=5
$1=1234
$2=12345
$3=123456
$4=12
$5=1
NF=5
$1=   4
$2=    5
$3=     6
$4= 2
$5=1
NF=4
$1=   4
$2=    5
$3=     6
$4= 2
NF=3
$1=1234
$2=12345
$3=12
NF=1
$1=12
NF=0
--------------------------------------------------
 ------ args: ../examples/demo_tmpfile
file 1
file 2
file 3
--------------------------------------------------
 ------ args: ../examples/demo_trim ../examples/demo_trim.in
trim_l("Van Der   Graaf   Generator  ")="Van Der   Graaf   Generator  "
trim_r("Van Der   Graaf   Generator  ")="Van Der   Graaf   Generator"
trim_c("Van Der   Graaf   Generator  ")="Van Der Graaf Generator "
trim_lr("Van Der   Graaf   Generator  ")="Van Der   Graaf   Generator"
trim_lrc("Van Der   Graaf   Generator  ")="Van Der Graaf Generator"
trim_l("    Peter Hammill")="Peter Hammill"
trim_r("    Peter Hammill")="    Peter Hammill"
trim_c("    Peter Hammill")=" Peter Hammill"
trim_lr("    Peter Hammill")="Peter Hammill"
trim_lrc("    Peter Hammill")="Peter Hammill"
trim_l("  King  Crimson")="King  Crimson"
trim_r("  King  Crimson")="  King  Crimson"
trim_c("  King  Crimson")=" King Crimson"
trim_lr("  King  Crimson")="King  Crimson"
trim_lrc("  King  Crimson")="King Crimson"
trim_l("Robert    Fripp")="Robert    Fripp"
trim_r("Robert    Fripp")="Robert    Fripp"
trim_c("Robert    Fripp")="Robert Fripp"
trim_lr("Robert    Fripp")="Robert    Fripp"
trim_lrc("Robert    Fripp")="Robert Fripp"
trim_l("   Jethro   Tull")="Jethro   Tull"
trim_r("   Jethro   Tull")="   Jethro   Tull"
trim_c("   Jethro   Tull")=" Jethro Tull"
trim_lr("   Jethro   Tull")="Jethro   Tull"
trim_lrc("   Jethro   Tull")="Jethro Tull"
trim_l("Jan Anderson")="Jan Anderson"
trim_r("Jan Anderson")="Jan Anderson"
trim_c("Jan Anderson")="Jan Anderson"
trim_lr("Jan Anderson")="Jan Anderson"
trim_lrc("Jan Anderson")="Jan Anderson"
--------------------------------------------------
 ------ args: ../examples/demo_trim_in ../examples/demo_trim.in
Van Der   Graaf   Generator
Peter Hammill
King  Crimson
Robert    Fripp
Jethro   Tull
Jan Anderson
--------------------------------------------------
 ------ args: -v TRIM=  ../examples/demo_trim_in ../examples/demo_trim.in
Van Der   Graaf   Generator  
    Peter Hammill
  King  Crimson
Robert    Fripp
   Jethro   Tull
Jan Anderson
--------------------------------------------------
 ------ args: -v TRIM=c ../examples/demo_trim_in ../examples/demo_trim.in
Van Der Graaf Generator 
 Peter Hammill
 King Crimson
Robert Fripp
 Jethro Tull
Jan Anderson
--------------------------------------------------
 ------ args: ../examples/demo_glob2ere
--------------------------------------------------
 ------ args: ../examples/demo_backslash_in ../examples/demo_backslash_in.in
Some text here and here too. This is still the first line.
This is the second.
And this is third one that continues on the next line and the next line too.
Ok, we finally have four lines of text.
--------------------------------------------------
 ------ args: ../examples/demo_ini : ../examples/demo_ini.in
value [me:citizenship]=Belarus
value [me:e-mail]=vle@gmx.net, cheusov@tut.by
value [me:full name]=Aleksey Cheusov
value [me:hobby]=programming, UNIX-like OSes, open source software, music
value [me:home page]=http://mova.org/~cheusov/
value [me:jabber]=cheusov@mova.org
value [me:nationality]=Russian
value [me:sex]=male
value [system:OS]=NetBSD
value [system:OSVER]=5.1_RC3
value [system:host]=localhost
value [system:network interface]=nfe0
value [tests:val1]=  123  45  
value [tests:val2]=  123  45  
value [tests:val3]=  '123  45'  
value [tests:val4]=  "123  45"  
value [tests:val5]=  "123  ;"  
value [tests:val6]=  '###123  ;'  
value [tests:val7]=1 2 3 4 5 6 7
--------------------------------------------------
 ------ args: ../examples/demo_ini  ../examples/demo_ini.in
value [me.citizenship]=Belarus
value [me.e-mail]=vle@gmx.net, cheusov@tut.by
value [me.full name]=Aleksey Cheusov
value [me.hobby]=programming, UNIX-like OSes, open source software, music
value [me.home page]=http://mova.org/~cheusov/
value [me.jabber]=cheusov@mova.org
value [me.nationality]=Russian
value [me.sex]=male
value [system.OS]=NetBSD
value [system.OSVER]=5.1_RC3
value [system.host]=localhost
value [system.network interface]=nfe0
value [tests.val1]=  123  45  
value [tests.val2]=  123  45  
value [tests.val3]=  '123  45'  
value [tests.val4]=  "123  45"  
value [tests.val5]=  "123  ;"  
value [tests.val6]=  '###123  ;'  
value [tests.val7]=1 2 3 4 5 6 7
--------------------------------------------------
 ------ args: alt_getopt #1
help
help
verbose=1
verbose=1
echo 'alt_getopt-0-1-0 written by Aleksey Cheusov <vle@gmx.net>'
output='123'
output='234'
output='file with spaces'
number='999'
number='9999'
len='5'
fake_flag=1
help
echo 'alt_getopt-0-1-0 written by Aleksey Cheusov <vle@gmx.net>'
verbose=1
len='10'
len='100'
msg='Aleksey'\''s cat is female'
msg='backslashes (\) is not a problem too'
shift 24
--------------------------------------------------
 ------ args: demo_alt_getopt.sh #1
verbose=0
fake_flag=
len=
output=
msg=
n=
flag=
quiet=
--------------------------------------------------
 ------ args: demo_alt_getopt.sh #1.5
verbose=0
fake_flag=
len=
output=
msg=
n=
flag=
quiet=
arg [1]=arg1
arg [2]=arg2
arg [3]=arg3
--------------------------------------------------
 ------ args: demo_alt_getopt.sh #2
verbose=0
fake_flag=
len=
output=
msg=Aleksey's cat is female
n=123
flag=
quiet=
arg [1]=arg1
--------------------------------------------------
 ------ args: demo_alt_getopt.sh #3
verbose=0
fake_flag=
len=123
output=
msg=Aleksey's cat is female
n=
flag=
quiet=
arg [1]=arg1
arg [2]=arg2
--------------------------------------------------
 ------ args: demo_alt_getopt.sh #4
verbose=0
fake_flag=
len=123
output=
msg=Aleksey's cat is female
n=
flag=1
quiet=
arg [1]=-a1
arg [2]=-a2
--------------------------------------------------
 ------ args: demo_alt_getopt.sh #5
blablabla help
verbose=3
fake_flag=
len=100
output=/path/to/file.out
msg=
n=123
flag=
quiet=
--------------------------------------------------
 ------ args: demo_alt_getopt.sh #5
blablabla help
verbose=0
fake_flag=
len=100
output=/path/to/file.out
msg=
n=123
flag=
quiet=1
--------------------------------------------------
 ------ args: demo_alt_getopt2.sh #1
demo_alt_getopt2.sh is a demo program for alt_getopt.sh
OPTIONS:
  -h|--help        display this help
  -v|--version     display version
  -o|--output      output file

--------------------------------------------------
 ------ args: demo_alt_getopt2.sh #2
demo_alt_getopt2.sh 0.1.0
output=
--------------------------------------------------
 ------ args: demo_alt_getopt2.sh #3
output=/path/to/file with spaces.txt
--------------------------------------------------
 ------ args: demo_alt_getopt2.sh #4
output=file.txt
$1=arg1
$2=arg2
$3=arg3
--------------------------------------------------
 ------ args: demo_alt_getopt2.sh #5
output=
$1=-ofile.txt
$2=arg1
--------------------------------------------------
 ------ args: demo_alt_getopt2.sh #6
output=
$1=-o
$2=file.txt
$3=arg1
--------------------------------------------------
 ------ args: demo_alt_getopt2.sh #7
output=file.txt
$1=arg1
--------------------------------------------------
 ------ args: demo_minmax #1
--------------------------------------------------
 ------ args: ../examples/demo_ftrans /dev/null
--------------------------------------------------
 ------ args: ../examples/demo_ftrans ../examples/demo_readfile.in
#### beginning of ../examples/demo_readfile.in ####
line1
line2
line3
#### end of ../examples/demo_readfile.in ####
--------------------------------------------------
 ------ args: ../examples/demo_ftrans ../examples/demo_readfile.in ../examples/demo_shquote.in ../examples/demo_fieldwidths.in
#### beginning of ../examples/demo_readfile.in ####
line1
line2
line3
#### end of ../examples/demo_readfile.in ####
#### beginning of ../examples/demo_shquote.in ####
'
''
'''
\
\\
\\\
\\'
'\'

Apple's
apple
file name.txt
*&;<>#~^$`!][(){}?
#### end of ../examples/demo_shquote.in ####
#### beginning of ../examples/demo_fieldwidths.in ####
12341234512345612100000
   4    5     6 21
   4    5     6 2
12341234512
12

#### end of ../examples/demo_fieldwidths.in ####
--------------------------------------------------
 ------ args: ../examples/demo_ftrans
#### beginning of - ####
foo
bar
baz
#### end of - ####
--------------------------------------------------
 ------ args: -F #1
new_argv [0] = awk
new_argv [1] = -F
new_argv [2] = :
new_argv [3] = {print}
--------------------------------------------------
 ------ args: -F #2
new_argv [0] = awk
new_argv [1] = -F
new_argv [2] = :
new_argv [3] = {print}
--------------------------------------------------
 ------ args: -F #3
a=1 4:1 2 3 4
b=2 4:1 2 3 4
--------------------------------------------------
 ------ args: xargs + runawk #1
49950000
--------------------------------------------------
 ------ args: exitnow.awk #1
--------------------------------------------------
 ------ args: ../examples/demo_io
File ../Makefile is a generic file: 1
File ../Makefile is a socket: 0
File ../Makefile is a directory: 0
File ../Makefile is executable: 0
File ../Makefile is a FIFO: 0
File ../Makefile is a symlink: 0
File ../Makefile is a block device file: 0
File ../Makefile is a character device file: 0
The size of ../Makefile is 750 bytes
The type of ../Makefile is -
File /nonexistent is a generic file: 0
File /nonexistent is a socket: 0
File /nonexistent is a directory: 0
File /nonexistent is executable: 0
File /nonexistent is a FIFO: 0
File /nonexistent is a symlink: 0
File /nonexistent is a block device file: 0
File /nonexistent is a character device file: 0
The size of /nonexistent is -2 bytes
The type of /nonexistent is 
File /dev/null is a generic file: 0
File /dev/null is a socket: 0
File /dev/null is a directory: 0
File /dev/null is executable: 0
File /dev/null is a FIFO: 0
File /dev/null is a symlink: 0
File /dev/null is a block device file: 0
File /dev/null is a character device file: 1
The size of /dev/null is -1 bytes
The type of /dev/null is c
File . is a generic file: 0
File . is a socket: 0
File . is a directory: 1
File . is executable: 1
File . is a FIFO: 0
File . is a symlink: 0
File . is a block device file: 0
File . is a character device file: 0
The size of . is -1 bytes
The type of . is d
File symlink.tmp is a generic file: 1
File symlink.tmp is a socket: 0
File symlink.tmp is a directory: 0
File symlink.tmp is executable: 1
File symlink.tmp is a FIFO: 0
File symlink.tmp is a symlink: 1
File symlink.tmp is a block device file: 0
File symlink.tmp is a character device file: 0
The size of symlink.tmp is -1 bytes
The type of symlink.tmp is l
File fifo.tmp is a generic file: 0
File fifo.tmp is a socket: 0
File fifo.tmp is a directory: 0
File fifo.tmp is executable: 0
File fifo.tmp is a FIFO: 1
File fifo.tmp is a symlink: 0
File fifo.tmp is a block device file: 0
File fifo.tmp is a character device file: 0
The size of fifo.tmp is -1 bytes
The type of fifo.tmp is p