1MAWK-CODE(7)                     Miscellaneous                    MAWK-CODE(7)
2
3
4

NAME

6       mawk-code - dumping mawk's byte-code
7

SYNOPSIS

9       At  startup,  mawk  compiles the script into byte-code.  After that, it
10       interprets the compiled byte-code.  Use the -Wdump option to  show  the
11       byte-code.
12

PROGRAM CODES

14       As  mawk  executes the program, it maintains a reference to the command
15       to execute in cdp.  After that there may be data and/or  references  in
16       cdp[0], cdp[1], etc.
17
18       When  an  operation  requires  operands, mawk pushes the values (or ar‐
19       ray/string references) onto the stack, which updates the stack  pointer
20       sp.   When  the operation completes, mawk consumes those entries on the
21       stack, pushing the result (if any) onto the stack.
22
23       While executing user-defined functions, mawk maintains a frame  pointer
24       fp to address the function's local variables.
25
26   a_cat
27       Concatenate array-indices.
28
29       Usage:
30            Forms  a  multiple  array  index  by concatenating the elements of
31            sp[1-cnt..0], with each element separated by SUBSEP.
32
33       Parameters:
34
35            cdp[0]
36                 cnt, the number of elements to concatenate follows  the  com‐
37                 mand.
38
39            sp[0]..sp[1-cnt]
40                 hold reference to the elements to concatenate.
41
42       Returns the index in sp[0].
43
44   a_del
45       Delete an array item.
46
47       Usage:
48            delete array[expr]
49
50       Parameters:
51
52            sp[0]
53                 points to array
54
55            sp[-1]
56                 is an expr
57
58   a_length
59       Find the length of an array.
60
61       Usage:
62            length(array)
63
64       Parameters:
65
66            sp[0]
67                 points to array.
68
69       Returns the length of the array in sp[0].
70
71   a_pusha
72       Push array address onto stack.
73
74       Usage:
75            This is used to set up a calling argument for a function.
76
77       Parameters:
78
79            cdp[0]
80                 array reference follows the command.
81
82       Returns the array in sp[0].
83
84   a_test
85       Test if an expression is present in an array.
86
87       Usage:
88            (expression in array)
89
90       Parameters:
91
92            sp[0]
93                 points to an array.
94
95            sp[-1]
96                 is an expression.
97
98       Returns 1 in sp[0] if the expression is found, 0 otherwise.
99
100   add
101       Add two numbers.
102
103       Usage:
104            first + second
105
106       Parameters:
107
108            sp[0]
109                 holds the second value.
110
111            sp[-1]
112                 holds the first value.
113
114       Returns the sum in sp[0].
115
116   add_asg
117       Combined addition/assignment.
118
119       Usage:
120            target += source
121
122       Parameters:
123
124            sp[0]
125                 is the source expression
126
127            sp[-1]
128                 points to the target
129
130       Stores the sum in the target, leaving sp[0] pointing to the target.
131
132   ae_pusha
133       Push reference to array cell, given expression for its index.
134
135       Usage:
136            arrayname[expression]
137
138       Parameters:
139
140            cdp[0]
141                 an array reference follows the command.
142
143            sp[0]
144                 has an expression, used for the index of a cell in the array.
145
146       Returns a reference to the addressed cell in sp[0].
147
148   ae_pushi
149       Push contents of array cell, given expression for its index.
150
151       Usage:
152            arrayname[expression]
153
154       Parameters:
155
156            sp[0]
157                 has an expression, used for the index of a cell in the array.
158
159       Returns contents of the addressed cell in sp[0].
160
161   aloop
162       Update reference to next cell for array loop.
163
164       Usage:
165            for ( i in arrayname )  statement
166
167       Parameters:
168
169            none
170
171       Mawk  maintains a stack of array-loop state.  It updates the array/cell
172       references in the current loop's state.
173
174   assign
175       Assigns a value.
176
177       Usage:
178            target = source
179
180       Parameters:
181
182            sp[0]
183                 is the source expression
184
185            sp[-1]
186                 points to the target
187
188            Stores the sum in the target, leaving sp[0] pointing to  the  tar‐
189            get.
190
191   atan2
192       Compute arc-tangent of two values.
193
194       Usage:
195            atan2( first, second )
196
197       Parameters:
198
199            sp[0]
200                 holds the second value
201
202            sp[-1]
203                 holds the first value
204
205       Returns the result in sp[0].
206
207   call
208       Call a function.
209
210       Usage:
211            function()
212
213       Parameters:
214
215            cdp[0]
216                 is a reference to the function block
217
218            cdp[1]
219                 holds number of input arguments
220
221       Returns function value in sp[0].
222
223   cat
224       Concatenate two strings.
225
226       Usage:
227            first second
228
229       Parameters:
230
231            sp[0]
232                 is the second string.
233
234            sp[-1]
235                 is the first string.
236
237       Returns the result in sp[0].
238
239   close
240       Close the file or pipe associated with an expression.
241
242       Usage:
243            close( expression )
244
245       Parameters:
246
247            sp[0]
248                 holds the expression identifying the file to close
249
250       Returns  the  status from closing the file, 0 on success or -1 on fail‐
251       ure.
252
253   cos
254       Compute the cosine of a value in radians.
255
256       Usage:
257            cos( value )
258
259       Parameters:
260
261            sp[0]
262                 is the value.
263
264       Returns the result in sp[0].
265
266   del_a
267       Delete an array.
268
269       Usage:
270            delete(array)
271
272       Parameters:
273
274            sp[0]
275                 is the array to delete.
276
277   div
278       Divide one number by another.
279
280       Usage:
281            first / second
282
283       Parameters:
284
285            sp[0]
286                 is the second value.
287
288            sp[-1]
289                 is the first value.
290
291       Returns the quotient in sp[0].
292
293   div_asg
294       Combined division/assignment.
295
296       Usage:
297            target /= source
298
299       Parameters:
300
301            sp[0]
302                 is the source
303
304            sp[-1]
305                 points to the target
306
307       Stores the quotient in the target, leaving sp[0] pointing to  the  tar‐
308       get.
309
310   eq
311       Compare two values.
312
313       Usage:
314            first == second
315
316       Parameters:
317
318            sp[0]
319                 is the second value
320
321            sp[-1]
322                 is the first value
323
324       Returns 1 in sp[0] if the values are equal, otherwise 0.
325
326   exit
327       Exits mawk with a specific exit-code.
328
329       Usage:
330            exit(exit_code)
331
332       Parameters:
333
334            sp[0]
335                 is the exit_code
336
337   exit0
338       Exits mawk with success
339
340       Usage:
341            exit
342
343       Parameters:
344            none
345
346   exp
347       Compute base-e exponential function of a value.
348
349       Usage:
350            exp( value )
351
352       Parameters:
353
354            sp[0]
355                 is the value
356
357       Returns the result in sp[0].
358
359   f_add_asg
360       Combination addition/assignment to NF.
361
362       Usage:
363            NF += expression
364
365       Parameters:
366
367            sp[0]
368                 is the expression to add
369
370   f_assign
371       Assign an expression to NF.
372
373       Usage:
374            NF = expression
375
376       Parameters:
377
378            sp[0]
379                 is the expression
380
381   f_div_asg
382       Combination division/assignment to NF.
383
384       Usage:
385            NF /= expression
386
387       Parameters:
388
389            sp[0]
390                 is the expression
391
392   f_mod_asg
393       Combination modulus/assignment to NF.
394
395       Usage:
396            NF %= expression
397
398       Parameters:
399
400            sp[0]
401                 is the expression
402
403   f_mul_asg
404       Combination multiplication/assignment to NF.
405
406       Usage:
407            NF *= expression
408
409       Parameters:
410
411            sp[0]
412                 is the expression
413
414   f_post_dec
415       Post-decrement using NF.
416
417       Usage:
418            NF--
419
420       Parameters:
421            holds a reference to the field to use
422
423   f_post_inc
424       Post-increment using NF.
425
426       Usage:
427            NF++
428
429       Parameters:
430            holds a reference to the field to use
431
432   f_pow_asg
433       Exponentiation using NF.
434
435       Usage:
436            NF ^= expression
437
438       Parameters:
439
440            sp[0]
441                 is the expression to use
442
443   f_pre_dec
444       Predecrement using NF.
445
446       Usage:
447            --NF
448
449       Parameters:
450
451            sp[0]
452                 holds a reference to the field to use
453
454   f_pre_inc
455       Preincrement using NF.
456
457       Usage:
458            ++NF
459
460       Parameters:
461
462            sp[0]
463                 holds a reference to the field to use
464
465   f_pusha
466       Push array reference to data split-up as fields..
467
468       Usage:
469            $0 = expression
470            getline
471
472       Parameters:
473
474            cdp[0]
475                 is a reference to the data to be split/assigned.
476
477       Returns the resulting array reference in sp[0].
478
479   f_pushi
480       Push contents of numbered field.
481
482       Usage:
483            $expression
484
485       Parameters:
486
487            cdp[0]
488                 holds a reference to $expression
489
490            cdp[1]
491                 holds expression
492
493       Returns the field's value in sp[0].
494
495   f_sub_asg
496       Combination subtraction/assignment to NF.
497
498       Usage:
499            NF -= expression
500
501       Parameters:
502
503            sp[0]
504                 holds a reference to the field to use
505
506   fe_pusha
507       Push reference to numbered field.
508
509       Usage:
510            $number
511
512       Parameters:
513
514            sp[0]
515                 holds the field number
516
517       Returns a reference to the field in sp[0].
518
519   fe_pushi
520       Push content of numbered field.
521
522       Usage:
523            $number
524
525       Parameters:
526
527            sp[0]
528                 holds the field number
529
530       Returns the field's content in sp[0].
531
532   fflush
533       Flush the output file or pipe associated with an expression.
534
535       Usage:
536            fflush( expression )
537
538       Parameters:
539
540            sp[0]
541                 is the expression value
542
543       Returns the result in sp[0].
544
545   gt
546       Test if first value is greater than the second.
547
548       Usage:
549            first > second
550
551       Parameters:
552
553            sp[0]
554                 holds the second value.
555
556            sp[-1]
557                 holds the first value.
558
559       Returns 1 in sp[0] if the first value is greater than, otherwise 0.
560
561   gte
562       Test if first value is greater than or equal to the second.
563
564       Usage:
565            first >= second
566
567       Parameters:
568
569            sp[0]
570                 holds the second value.
571
572            sp[-1]
573                 holds the first value.
574
575       Returns  1 in sp[0] if the first value is greater than or equal, other‐
576       wise 0.
577
578   index
579       Find the position of the second string in the first.
580
581       Usage:
582            index( first, second )
583
584       Parameters:
585
586            sp[0]
587                 is the second string
588
589            sp[0]
590                 is the first string
591
592       Returns the position in sp[0] starting at 1 if found, 0 if not found.
593
594   int
595       Returns a value truncated towards zero..
596
597       Usage:
598            int( value )
599
600       Parameters:
601
602            sp[0]
603                 is the value
604
605       Returns the result in sp[0].
606
607   jmain
608       Go from BEGIN code to MAIN code.
609
610       Usage:
611            (internal state)
612
613       Parameters:
614
615            none
616
617   jmp
618       Jump to a new byte-code position, by a given number of bytes.
619
620       Usage:
621            (internal state)
622
623       Parameters:
624
625            cdp[0]
626                 holds the (signed) number of bytes by which to jump.
627
628   jnz
629       Jump to a new byte-code position if sp[0] is nonzero, by a given number
630       of bytes.
631
632       Usage:
633            (internal state)
634
635       Parameters:
636
637            cdp[0]
638                   holds the (signed) number of bytes by which to jump.
639
640            sp[0]
641                 holds a value to compare against 0.
642
643   jz
644       Jump to a new byte-code position if sp[0] is zero, by a given number of
645       bytes.
646
647       Usage:
648            (internal state)
649
650       Parameters:
651
652            cdp[0]
653                   holds the (signed) number of bytes by which to jump.
654
655            sp[0]
656                 holds a value to compare against 0.
657
658   l_pusha
659       Push a local address onto the evaluation stack.
660
661       Usage:
662            (internal state)
663
664       Parameters:
665
666            cdp[0]
667                 holds the offset from the frame pointer fp.
668
669       Returns the address in sp[0].
670
671   l_pushi
672       Push contents of a local variable onto the evaluation stack.
673
674       Usage:
675            (internal state)
676
677       Parameters:
678
679            cdp[0]
680                 holds the offset from the frame pointer fp.
681
682       Returns the contents of the local variable in sp[0].
683
684   la_pusha
685       Pushes a reference to an array onto the evaluation stack.
686
687       Usage:
688            arrayname
689
690       Parameters:
691
692            cdp[0]
693                 holds the offset from the frame pointer fp of a reference  to
694                 an array.
695
696       Returns a reference to the array in sp[0].
697
698   lae_pusha
699       Pushes a reference to a given array cell onto the evaluation stack.
700
701       Usage:
702            arrayname[expression]
703
704       Parameters:
705
706            cdp[0]
707                 holds  the offset from the frame pointer fp of a reference to
708                 an array.
709
710            sp[0]
711                 holds an expression
712
713       Returns a reference to the specified array cell in sp[0].
714
715   lae_pushi
716       Pushes the contents of a given array cell onto the evaluation stack.
717
718       Usage:
719            arrayname[expression]
720
721       Parameters:
722
723            cdp[0]
724                 holds the offset from the frame pointer fp of a reference  to
725                 an array.
726
727            sp[0]
728                 holds an expression
729
730       Returns the contents of the specified array cell in sp[0].
731
732   length
733       Returns the length of a string or array value.
734
735       Usage:
736            length( value )
737
738       Parameters:
739
740            sp[0]
741                 is the string or array reference
742
743       Returns the length in sp[0].
744
745   ljnz
746       Special jump for logical-OR, always preceded by test.
747
748       Usage:
749            (internal state)
750
751       Parameters:
752
753            cdp[0]
754                 holds  the  (signed)  number of bytes by which to jump if the
755                 value is nonzero.
756
757            sp[0]
758                 holds a value to compare against 0.
759
760   ljz
761       Special jump for logical-OR, always preceded by test.
762
763       Usage:
764            (internal state)
765
766       Parameters:
767
768            cdp[0]
769                 holds the (signed) number of bytes by which to  jump  if  the
770                 value is zero.
771
772            sp[0]
773                 holds a value to compare against 0.
774
775   log
776       Compute the natural logarithm of a value.
777
778       Usage:
779            log( value )
780
781       Parameters:
782
783            sp[0]
784                 is the value
785
786       Returns the result in sp[0].
787
788   lt
789       Test if first value is less than the second.
790
791       Usage:
792            first < second
793
794       Parameters:
795
796            sp[0]
797                 holds the second value.
798
799            sp[-1]
800                 holds the first value.
801
802       Returns 1 in sp[0] if the first value is less than, otherwise 0.
803
804   lte
805       Test if first value is less than or equal to the second.
806
807       Usage:
808            first <= second
809
810       Parameters:
811
812            sp[0]
813                 holds the second value.
814
815            sp[-1]
816                 holds the first value.
817
818       Returns  1 in sp[0] if the first value is less than or equal, otherwise
819       0.
820
821   match0
822       Test if $0 matches a given regular expression.
823
824       Usage:
825            $0 ~ regex
826
827       Parameters:
828
829            cdp[0]
830                 holds a reference to a regular expression.
831
832       Returns 1 in sp[0] if $0 matches the regular expression, 0 otherwise.
833
834   match1
835       Test if a given expression matches a given regular expression.
836
837       Usage:
838            expression ~ regex
839
840       Parameters:
841
842            cdp[0]
843                 holds a reference to a regular expression.
844
845            sp[0]
846                 holds an expression to test.
847
848       Returns 1 in sp[0] if the expression matches the regular expression,  0
849       otherwise.
850
851   match2
852       Test  if  an  expression  in  sp[-1]  matches the regular expression in
853       sp[0].
854
855       Usage:
856            expression ~ regex
857
858       Parameters:
859
860            sp[0]
861                 holds a reference to a regular expression.
862
863            sp[-1]
864                 holds an expression to test.
865
866       Returns 1 in sp[0] if the expression matches the regular expression,  0
867       otherwise.
868
869   mktime
870       Converts  a date specification in systime format to a timestamp.
871
872       Usage:
873            mktime( string )
874
875       Parameters:
876
877            sp[0]
878                 holds the date-specification string
879
880       Returns the result in sp[0].
881
882   mod
883       Compute modulus/remainder with two operands.
884
885       Usage:
886            first % second
887
888       Parameters:
889
890            sp[0]
891                 holds the second operand
892
893            sp[-1]
894                 holds the first operand
895
896       Returns the remainder in sp[0].
897
898   mod_asg
899       Assign modulus/remainder with two operands.
900
901       Usage:
902            first %= second
903
904       Parameters:
905
906            sp[0]
907                 holds the second operand
908
909            cdp[0]
910                 holds the first operand
911
912       Returns the remainder in sp[0] as well as replacing the first value.
913
914   mul
915       Compute product with two operands.
916
917       Usage:
918            first * second
919
920       Parameters:
921
922            sp[0]
923                 holds the second value
924
925            sp[-1]
926                 holds the first value
927
928       Returns the product in sp[0].
929
930   mul_asg
931       Assign product with two operands.
932
933       Usage:
934            first *= second
935
936       Parameters:
937
938            sp[0]
939                 holds the second value
940
941            sp[-1]
942                 holds the first value
943
944       Returns the product in sp[0] as well as replacing the first value.
945
946   neq
947       Compare two values.
948
949       Usage:
950            first != second
951
952       Parameters:
953
954            sp[0]
955                 is the second value
956
957            sp[-1]
958                 is the first value
959
960       Returns 1 in sp[0] if the values are not equal, otherwise 0.
961
962   next
963       Read the next record, restart pattern testing.
964
965       Usage:
966            next
967
968       Parameters:
969
970            none
971
972   nextfile
973       Begin processing the next file listed on the command line.
974
975       Usage:
976            nextfile
977
978       Parameters:
979
980            none
981
982   nf_pushi
983       Push the number of fields (NF) onto the evaluation stack.
984
985       Usage:
986            (internal state)
987
988       Parameters:
989
990            none
991
992   not
993       Compute a logical negation.
994
995       Usage:
996            ! value
997
998       Parameters:
999
1000            sp[0]
1001                 holds a value to negate.
1002
1003       Returns  the  result  on  the evaluation stack, i.e., 0 if the value is
1004       nonzero and 1 otherwise.
1005
1006   ol_gl
1007       Read into $0 using getline.
1008
1009       Usage:
1010            getline
1011
1012       Parameters:
1013
1014            none
1015
1016   ol_gl_nr
1017       Read into $0 using getline, updating NR and FNR.
1018
1019       Usage:
1020            getline < file
1021
1022       Parameters:
1023
1024            none
1025
1026   omain
1027       Start executing the main section of the script (between BEGIN and END).
1028
1029       Usage:
1030            (internal state)
1031
1032       Parameters:
1033
1034            none
1035
1036   pop
1037       Pop the evaluation stack, discarding the value.
1038
1039       Usage:
1040            (internal state)
1041
1042       Parameters:
1043
1044            none
1045
1046   pop_al
1047       Finish an array “in” loop, deallocating the state information.
1048
1049       Usage:
1050            (internal state)
1051
1052       Parameters:
1053
1054            none
1055
1056   post_dec
1057       Post-decrement a value.
1058
1059       Usage:
1060            value --
1061
1062       Parameters:
1063
1064            sp[0]
1065                 holds the value to decrement
1066
1067       Returns the updated value in sp[0].
1068
1069   post_inc
1070       Post-increment a value.
1071
1072       Usage:
1073            value ++
1074
1075       Parameters:
1076
1077            sp[0]
1078                 holds the value to increment
1079
1080       Returns the updated value in sp[0].
1081
1082   pow
1083       Compute the first value raised to the power of the second value.
1084
1085       Usage:
1086            first ^ second
1087
1088       Parameters:
1089
1090            sp[0]
1091                 holds the second value
1092
1093            sp[-1]
1094                 holds the first value
1095
1096       Returns the result in sp[0].
1097
1098   pow_asg
1099       Assign the first value raised to the power of the second value.
1100
1101       Usage:
1102            variable = first ^ second
1103
1104       Parameters:
1105
1106            cdp[0]
1107                 is a reference to the variable which will be assigned the re‐
1108                 sult
1109
1110            sp[0]
1111                 holds the second value
1112
1113            sp[-1]
1114                 holds the first value
1115
1116   pre_dec
1117       Pre-decrement a value.
1118
1119       Usage:
1120            -- value
1121
1122       Parameters:
1123
1124            sp[0]
1125                 holds the value to decrement.
1126
1127       Returns the updated value in sp[0];.
1128
1129   pre_inc
1130       Pre-increment a value.
1131
1132       Usage:
1133            ++ value
1134
1135       Parameters:
1136
1137            sp[0]
1138                 holds the value to decrement.
1139
1140       Returns the updated value in sp[0];.
1141
1142   pusha
1143       Push array address onto stack.
1144
1145       Usage:
1146            (internal state)
1147
1148       Parameters:
1149
1150            cdp[0]
1151                 array reference follows the command.
1152
1153       Returns the array in sp[0].
1154
1155   pushc
1156       Push a data cell onto the evaluation stack.
1157
1158       Usage:
1159            (internal state)
1160
1161       Parameters:
1162
1163            cdp[0]
1164                 is a reference to the data to push
1165
1166       Returns a reference to the result in sp[0].
1167
1168   pushd
1169       Push a double floating value onto the evaluation stack.
1170
1171       Usage:
1172            (internal state)
1173
1174       Parameters:
1175
1176            cdp[0]
1177                 is a reference to the data to push
1178
1179       Returns a reference to the result in sp[0].
1180
1181   pushi
1182       Push contents of next referenced variable onto the evaluation stack.
1183
1184       Usage:
1185            (internal state)
1186
1187       Parameters:
1188
1189            cdp[0]
1190                 is a reference to the data cell to copy.
1191
1192       Returns a reference to the result in sp[0].
1193
1194   pushint
1195       Reserve the next slot on the evaluation stack, setting its type.
1196
1197       Usage:
1198            (internal state)
1199
1200       Parameters:
1201
1202            cdp[0]
1203                 holds the type to set in the new slot, e.g., for data via I/O
1204                 redirection
1205
1206       Returns a reference to the result in sp[0].
1207
1208   pushs
1209       Push a reference to a string value onto the evaluation stack.
1210
1211       Usage:
1212            (internal state)
1213
1214       Parameters:
1215
1216            cdp[0]
1217                 holds a reference to the string value
1218
1219       Returns a reference to the result in sp[0].
1220
1221   rand
1222       Returns a random number between zero and one..
1223
1224       Usage:
1225            rand()
1226
1227       Parameters:
1228
1229            none
1230
1231       Returns the result in sp[0].
1232
1233   range
1234       Test a range pattern:  pat1, pat2 { action }.
1235
1236       Usage:
1237            (internal state)
1238
1239       Parameters:
1240
1241            cdp[0].op
1242                 a flag, test pat1 if on else pat2
1243
1244            cdp[1].op
1245                 offset of pat2 code from cdp
1246
1247            cdp[2].op
1248                 offset of action code from cdp
1249
1250            cdp[3].op
1251                 offset of code after the action from cdp
1252
1253            cdp[4]
1254                 start of pat1 code
1255
1256            sp[0]
1257                 holds arguments for the action.
1258
1259   ret
1260       Return a function value.
1261
1262       Usage:
1263            return value
1264
1265       Parameters:
1266
1267            sp[0]
1268                 holds the return value
1269
1270       When calling a function, mawk saves the current stack, creating  a  new
1271       one.  On return, mawk restores the previous stack and returns the func‐
1272       tion value in sp[0].
1273
1274   ret0
1275       Return from a function without providing a return-value.
1276
1277       Usage:
1278            return
1279
1280       Parameters:
1281
1282            sp[0]
1283                 is modified to make the value uninitialized.
1284
1285       As in the ret operation, mawk restores the previous stack.   After  the
1286       return, sp[0] is an uninitialized value.
1287
1288   set_al
1289       Begin an array “in” loop.
1290
1291       Usage:
1292            for ( iterator in arrayname )  statement
1293
1294       Parameters:
1295
1296            sp[0]
1297                 holds a reference to the array
1298
1299            sp[-1]
1300                 holds a reference to the iteration variable
1301
1302       Mawk  pushes  a new entry onto the array loop stack, and updates cdp to
1303       point to the statement to execute.
1304
1305   sin
1306       Compute the sine of a value in radians.
1307
1308       Usage:
1309            sin( value )
1310
1311       Parameters:
1312
1313            sp[0]
1314                 holds the value
1315
1316       Returns the result in sp[0].
1317
1318   sprintf
1319       Returns a string constructed from expression-list according to format.
1320
1321       Usage:
1322            sprintf( format [, value1 [,... ] ] )
1323
1324       Parameters:
1325
1326            sp[0]
1327                 is the last parameter value; there can be up to 255.
1328       Returns the resulting string in sp[0].
1329
1330   sqrt
1331       Returns the square root of a value.
1332
1333       Usage:
1334            sqrt( value 0
1335
1336       Parameters:
1337
1338            sp[0]
1339                 is the value
1340
1341       Returns the result in sp[0].
1342
1343   srand
1344       Seeds the random number generator.
1345
1346       Usage:
1347            srand( value )
1348            srand( )
1349
1350       Parameters:
1351
1352            sp[0]
1353                 is the seed value, which may be uninitialized
1354
1355       Returns the previous seed value in sp[0].
1356
1357   stop
1358       Finish a range pattern.
1359
1360       Usage:
1361            (internal state)
1362
1363       Parameters:
1364
1365            none
1366
1367   strftime
1368       Formats the given timestamp using the given format.
1369
1370       Usage:
1371            strftime( format , timestamp , utc )
1372            strftime( format , timestamp )
1373            strftime( format )
1374            strftime( )
1375
1376       Parameters:
1377
1378            Zero to three parameters may be on the stack.  If  all  three  are
1379            used, they are as follows:
1380
1381            sp[0]
1382                 is the utc flag
1383
1384            sp[-1]
1385                 is the timestamp value
1386
1387            sp[-2]
1388                 is the format
1389
1390       Returns the result in sp[0].
1391
1392   sub
1393       Subtract the second value from the first.
1394
1395       Usage:
1396            first - second
1397
1398       Parameters:
1399
1400            sp[0]
1401                 holds the second value
1402
1403            sp[-1]
1404                 holds the first value
1405
1406            Returns the result in sp[0].
1407
1408   sub_asg
1409       Assign the difference of two values to a variable.
1410
1411       Usage:
1412            target = first - second
1413
1414       Parameters:
1415
1416            cdp[0]
1417                 holds  a reference to the variable to which to assign the re‐
1418                 sult
1419
1420            sp[0]
1421                 holds the second value
1422
1423            sp[-1]
1424                 holds the first value
1425
1426       Stores the difference in the target, leaving sp[0] pointing to the tar‐
1427       get.
1428
1429   substr
1430       eturns the substring of string s, starting at index i, of length n.
1431
1432       Usage:
1433            substr(s,i,n)
1434            substr(s,i)
1435
1436       Parameters:
1437
1438            Two  or  three  parameters  may be on the stack.  If all three are
1439            used, they are as follows:
1440
1441            sp[0]
1442                 holds the length n.
1443
1444            sp[0]
1445                 holds the index i.
1446
1447            sp[0]
1448                 holds the string s.
1449
1450   system
1451       Executes a command, returning the wait-status.
1452
1453       Usage:
1454            status = system( command )
1455
1456       Parameters:
1457
1458            sp[0]
1459                 is the command to execute
1460
1461       Returns the wait-status in sp[0].
1462
1463   systime
1464       Returns the current time of day as the  number  of  seconds  since  the
1465       Epoch.
1466
1467       Usage:
1468            systime( )
1469
1470       Parameters:
1471
1472            none
1473
1474       Returns the result in sp[0].
1475
1476   test
1477       Test a logical expression.
1478
1479       Usage:
1480            value
1481
1482       Parameters:
1483
1484            sp[0]
1485                 holds a value to test.
1486
1487       Returns  the  result  on  the evaluation stack, i.e., 1 if the value is
1488       nonzero and 0 otherwise.
1489
1490   tolower
1491       Copy a string, converting to lowercase.
1492
1493       Usage:
1494            tolower( value )
1495
1496       Parameters:
1497
1498            sp[0]
1499                 is the value to convert
1500
1501       Returns the result in sp[0].
1502
1503   toupper
1504       Copy a string, converting to uppercase.
1505
1506       Usage:
1507            toupper( value )
1508
1509       Parameters:
1510
1511            sp[0]
1512                 is the value to convert
1513
1514       Returns the result in sp[0].
1515
1516   uminus
1517       Unitary minus.
1518
1519       Usage:
1520            - value
1521
1522       Parameters:
1523
1524            sp[0]
1525                 contains a value to negate.  As a side-effect, if  the  value
1526                 is a string, it is cast to double floating point.
1527
1528       Returns the result in sp[0].
1529
1530   uplus
1531       Unitary plus.
1532
1533       Usage:
1534            + value
1535
1536       Parameters:
1537
1538            sp[0]
1539                 contains a value to use.  As a side-effect, if the value is a
1540                 string, it is cast to double floating point.
1541
1542            Returns the result in sp[0].
1543

REGULAR EXPRESSIONS

1545   M_1J
1546       mandatory jump
1547
1548   M_2JA
1549       optional (undesirable) jump
1550
1551   M_2JB
1552       optional (desirable) jump
1553
1554   M_2JC
1555       pop pos'n, optional jump if advanced
1556
1557   M_ACCEPT
1558       end of match
1559
1560   M_ANY
1561       arbitrary character (.)
1562
1563   M_CLASS
1564       character class
1565
1566   M_END
1567       end of string ($)
1568
1569   M_SAVE_POS
1570       push position onto stack
1571
1572   M_START
1573       start of string (^)
1574
1575   M_STR
1576       matching a literal string
1577
1578   M_U
1579       arbitrary string (.*)
1580
1581
1582
1583Version 1.3.4                     2020-08-21                      MAWK-CODE(7)
Impressum