MAWK-CODE(7)
๐ MAWK-CODE(7) ๐
mawk-code ยท Miscellaneous section ๐
โจ NAME โจ
mawk-code โ dumping mawk's byte-code ๐ง
๐ธ SYNOPSIS ๐ธ
okay so at startup, mawk compiles your script into byte-code ๐ค and then it interprets that compiled byte-code. if you wanna peek at it, use the -Wdump option ๐
๐ PROGRAM CODES ๐
okay bestie, so while mawk is running your program, it keeps a reference to the command it's currently on in cdp ๐ซถ. after that, there might be data and/or references sitting in cdp[0], cdp[1], etc. โจ
when an operation needs operands, mawk pushes the values (or array/string references) onto the stack, which updates the stack pointer sp ๐. once the operation is done, mawk eats those entries off the stack and pushes the result (if there is one) back on ๐
.
and while it's running user-defined functions, mawk keeps a frame pointer fp so it can find the function's local variables ๐ฆ.
๐ธ a_cat ๐ธ
Concatenate array-indices ๐
Usage:
Forms a multiple array index by concatenating the elements of
sp[1-cnt..0], with each element separated by SUBSEP.
Parameters:
cdp[0]โ thecnt(how many elements to concatenate) comes right after the command ๐ขsp[0]..sp[1-cnt]โ hold references to the elements to concatenate ๐งธ
It returns the index in sp[0] โจ
๐ฆ a_del ๐ฆ
Delete an array item ๐๏ธ
Usage:
delete array[expr]
Parameters:
sp[0]โ points to the array ๐ฆsp[-1]โ is anexpr๐ญ
๐ a_length ๐
Find the length of an array ๐
Usage:
length(array)
Parameters:
sp[0]โ points to the array ๐ฆ
It returns the length of the array in sp[0] ๐
๐ a_pusha ๐
Push the array address onto the stack ๐
Usage:
This is used to set up a calling argument for a function.
Parameters:
cdp[0]โ the array reference follows the command ๐
It returns the array in sp[0] ๐
๐ a_test ๐
Test if an expression is present in an array ๐
Usage:
(expression in array)
Parameters:
sp[0]โ points to an array ๐ฆsp[-1]โ is an expression ๐ญ
It returns 1 in sp[0] if the expression is found, 0 otherwise ๐ซถ
โ add โ
Add two numbers ๐งฎ
Usage:
first + second
Parameters:
sp[0]โ holds the second value ๐ฅsp[-1]โ holds the first value ๐ฅ
It returns the sum in sp[0] โจ
๐ add_asg ๐
Combined addition/assignment ๐
Usage:
target += source
Parameters:
sp[0]โ is the source expression ๐ฅsp[-1]โ points to the target ๐ฏ
It stores the sum in the target, and leaves sp[0] pointing to the target ๐
๐ง ae_pusha ๐ง
Push a reference to an array cell, given an expression for its index ๐
Usage:
arrayname[expression]
Parameters:
cdp[0]โ an array reference follows the command ๐sp[0]โ has an expression, used for the index of a cell in the array ๐๏ธ
It returns a reference to the addressed cell in sp[0] ๐
๐ซง ae_pushi ๐ซง
Push the contents of an array cell, given an expression for its index ๐
Usage:
arrayname[expression]
Parameters:
sp[0]โ has an expression, used for the index of a cell in the array ๐๏ธ
It returns the contents of the addressed cell in sp[0] ๐ธ
๐ aloop ๐
Update the reference to the next cell for an array loop ๐
Usage:
for ( i in arrayname ) statement
Parameters:
- none ๐
mawk keeps a stack of array-loop state ๐. it updates the array/cell references in the current loop's state ๐ซ.
๐๏ธ assign ๐๏ธ
Assigns a value ๐
Usage:
target = source
Parameters:
sp[0]โ is the source expression ๐ฅsp[-1]โ points to the target ๐ฏ- Stores the sum in the target, leaving
sp[0]pointing to the target. ๐
๐ atan2 ๐
Compute the arc-tangent of two values ๐
Usage:
atan2( first, second )
Parameters:
sp[0]โ holds the second value ๐ฅsp[-1]โ holds the first value ๐ฅ
It returns the result in sp[0] โจ
๐ call ๐
Call a function ๐ฃ
Usage:
function()
Parameters:
cdp[0]โ is a reference to the function block ๐งฑcdp[1]โ holds the number of input arguments ๐ข
It returns the function value in sp[0] ๐
๐พ cat ๐พ
Concatenate two strings ๐งต
Usage:
first second
Parameters:
sp[0]โ is the second string ๐ฅsp[-1]โ is the first string ๐ฅ
It returns the result in sp[0] ๐
๐ช close ๐ช
Close the file or pipe associated with an expression ๐
Usage:
close( expression )
Parameters:
sp[0]โ holds the expression identifying the file to close ๐๏ธ
It returns the status from closing the file: 0 on success or -1 on failure ๐ฅน
๐ cos ๐
Compute the cosine of a value in radians ๐
Usage:
cos( value )
Parameters:
sp[0]โ is the value ๐ข
It returns the result in sp[0] โจ
๐๏ธ del_a ๐๏ธ
Delete an array ๐
Usage:
delete(array)
Parameters:
sp[0]โ is the array to delete ๐ฆ
โ div โ
Divide one number by another ๐ฐ
Usage:
first / second
Parameters:
sp[0]โ is the second value ๐ฅsp[-1]โ is the first value ๐ฅ
It returns the quotient in sp[0] ๐ซ
๐ซถ div_asg ๐ซถ
Combined division/assignment โ๐
Usage:
target /= source
Parameters:
sp[0]โ is the source ๐ฅsp[-1]โ points to the target ๐ฏ
It stores the quotient in the target, and leaves sp[0] pointing to the target ๐
๐ฐ eq ๐ฐ
Compare two values ๐ฏ
Usage:
first == second
Parameters:
sp[0]โ is the second value ๐ฅsp[-1]โ is the first value ๐ฅ
It returns 1 in sp[0] if the values are equal, otherwise 0 ๐ซง
๐ exit ๐
Exits mawk with a specific exit-code ๐จ
Usage:
exit(exit_code)
Parameters:
sp[0]โ is theexit_code๐ข
โ exit0 โ
Exits mawk with success ๐ฅณ
Usage:
exit
Parameters:
- none ๐
๐ exp ๐
Compute the base-e exponential function of a value ๐ฑ
Usage:
exp( value )
Parameters:
sp[0]โ is the value ๐ข
It returns the result in sp[0] โจ
โ f_add_asg โ
Combined addition/assignment to NF ๐
Usage:
NF += expression
Parameters:
sp[0]โ is the expression to add โ
๐ f_assign ๐
Assign an expression to NF ๐๏ธ
Usage:
NF = expression
Parameters:
sp[0]โ is the expression ๐ญ
โ f_div_asg โ
Combined division/assignment to NF ๐ซถ
Usage:
NF /= expression
Parameters:
sp[0]โ is the expression ๐ญ
๐งฎ f_mod_asg ๐งฎ
Combined modulus/assignment to NF ๐
Usage:
NF %= expression
Parameters:
sp[0]โ is the expression ๐ญ
โ๏ธ f_mul_asg โ๏ธ
Combined multiplication/assignment to NF ๐ซ
Usage:
NF *= expression
Parameters:
sp[0]โ is the expression ๐ญ
โฌ๏ธ f_post_dec โฌ๏ธ
Post-decrement using NF ๐
Usage:
NF--
Parameters:
- holds a reference to the field to use ๐ฏ
โฌ๏ธ f_post_inc โฌ๏ธ
Post-increment using NF ๐
Usage:
NF++
Parameters:
- holds a reference to the field to use ๐ฏ
๐บ f_pow_asg ๐บ
Exponentiation using NF ๐ฅ
Usage:
NF ^= expression
Parameters:
sp[0]โ is the expression to use ๐ญ
โฌ f_pre_dec โฌ
Predecrement using NF ๐
Usage:
--NF
Parameters:
sp[0]โ holds a reference to the field to use ๐ฏ
โซ f_pre_inc โซ
Preincrement using NF ๐
Usage:
++NF
Parameters:
sp[0]โ holds a reference to the field to use ๐ฏ
๐งฉ f_pusha ๐งฉ
Push an array reference to data split up as fields ๐ช
Usage:
$0 = expression
getline
Parameters:
cdp[0]โ is a reference to the data to be split/assigned ๐งท
It returns the resulting array reference in sp[0] ๐
๐ข f_pushi ๐ข
Push the contents of a numbered field ๐ฌ
Usage:
$expression
Parameters:
cdp[0]โ holds a reference to$expression๐ฏcdp[1]โ holdsexpression๐๏ธ
It returns the field's value in sp[0] ๐ธ
โ f_sub_asg โ
Combined subtraction/assignment to NF ๐
Usage:
NF -= expression
Parameters:
sp[0]โ holds a reference to the field to use ๐ฏ
๐ฏ fe_pusha ๐ฏ
Push a reference to a numbered field ๐
Usage:
$number
Parameters:
sp[0]โ holds the field number ๐ข
It returns a reference to the field in sp[0] ๐
๐ญ fe_pushi ๐ญ
Push the content of a numbered field ๐ฌ
Usage:
$number
Parameters:
sp[0]โ holds the field number ๐ข
It returns the field's content in sp[0] โจ
๐ฟ fflush ๐ฟ
Flush the output file or pipe associated with an expression ๐ง
Usage:
fflush( expression )
Parameters:
sp[0]โ is the expression value ๐๏ธ
It returns the result in sp[0] ๐
๐ gt ๐
Test if the first value is greater than the second ๐
Usage:
first > second
Parameters:
sp[0]โ holds the second value ๐ฅsp[-1]โ holds the first value ๐ฅ
It returns 1 in sp[0] if the first value is greater than the second, otherwise 0 ๐ซถ
๐ gte ๐
Test if the first value is greater than or equal to the second ๐
Usage:
first >= second
Parameters:
sp[0]โ holds the second value ๐ฅsp[-1]โ holds the first value ๐ฅ
It returns 1 in sp[0] if the first value is greater than or equal to the second, otherwise 0 ๐
๐ index ๐
Find the position of the second string in the first ๐ต๏ธโโ๏ธ
Usage:
index( first, second )
Parameters:
sp[0]โ is the second string ๐ฅsp[0]โ is the first string ๐ฅ
It returns the position in sp[0], starting at 1 if found and 0 if not found ๐
๐ int ๐
Returns a value truncated towards zero ๐ช
Usage:
int( value )
Parameters:
sp[0]โ is the value ๐ข
It returns the result in sp[0] โจ
๐ฆ jmain ๐ฆ
Go from BEGIN code to MAIN code ๐ฃ๏ธ
Usage:
(internal state)
Parameters:
- none ๐
๐ฆ jmp ๐ฆ
Jump to a new byte-code position, by a given number of bytes ๐โโ๏ธ
Usage:
(internal state)
Parameters:
cdp[0]โ holds the (signed) number of bytes by which to jump ๐ข
๐ช jnz ๐ช
Jump to a new byte-code position if sp[0] is nonzero, by a given number of bytes ๐ซ
Usage:
(internal state)
Parameters:
cdp[0]โ holds the (signed) number of bytes by which to jump ๐ขsp[0]โ holds a value to compare against 0. ๐
๐ฆ jz
Jumps to a new byte-code position if sp[0] is zero, by a given number of bytes. ๐ธ
Usage:
(internal state)
Parameters:
cdp[0]โ holds the (signed) number of bytes by which to jump. โจsp[0]โ holds a value to compare against 0.
๐ง l_pusha
Pushes a local address onto the evaluation stack. ๐
Usage:
(internal state)
Parameters:
cdp[0]โ holds the offset from the frame pointerfp.
Returns the address in sp[0].
๐ l_pushi
Pushes the contents of a local variable onto the evaluation stack. ๐
Usage:
(internal state)
Parameters:
cdp[0]โ holds the offset from the frame pointerfp.
Returns the contents of the local variable in sp[0].
๐ la_pusha
Pushes a reference to an array onto the evaluation stack. ๐ซถ
Usage:
arrayname
Parameters:
cdp[0]โ holds the offset from the frame pointerfpof a reference to an array.
Returns a reference to the array in sp[0].
๐ lae_pusha
Pushes a reference to a given array cell onto the evaluation stack. ๐ฅ
Usage:
arrayname[expression]
Parameters:
cdp[0]โ holds the offset from the frame pointerfpof a reference to an array.sp[0]โ holds an expression
Returns a reference to the specified array cell in sp[0].
๐ lae_pushi
Pushes the contents of a given array cell onto the evaluation stack. ๐ธ
Usage:
arrayname[expression]
Parameters:
cdp[0]โ holds the offset from the frame pointerfpof a reference to an array.sp[0]โ holds an expression
Returns the contents of the specified array cell in sp[0].
โญ length
Gives you the length of a string or array value. No cap, it's that simple. ๐
Usage:
length( value )
Parameters:
sp[0]โ is the string or array reference
Returns the length in sp[0].
๐ ljnz
A special jump for logical-OR, and it's always preceded by a test. Lowkey tricky, bestie. ๐ง
Usage:
(internal state)
Parameters:
cdp[0]โ holds the (signed) number of bytes by which to jump if the value is nonzero.sp[0]โ holds a value to compare against 0.
๐ ljz
A special jump for logical-OR, and it's always preceded by a test. Same energy as ljnz, just the opposite vibe. ๐ฆ
Usage:
(internal state)
Parameters:
cdp[0]โ holds the (signed) number of bytes by which to jump if the value is zero.sp[0]โ holds a value to compare against 0.
๐ log
Computes the natural logarithm of a value. Big brain moment. ๐ง โจ
Usage:
log( value )
Parameters:
sp[0]โ is the value
Returns the result in sp[0].
๐ lt
Tests if the first value is less than the second. โจ
Usage:
first < second
Parameters:
sp[0]โ holds the second value.sp[-1]โ holds the first value.
Returns 1 in sp[0] if the first value is less than, otherwise 0.
๐ซถ lte
Tests if the first value is less than or equal to the second. Slightly more generous, but still iconic. ๐
Usage:
first <= second
Parameters:
sp[0]โ holds the second value.sp[-1]โ holds the first value.
Returns 1 in sp[0] if the first value is less than or equal, otherwise 0.
๐ฅ match0
Tests if $0 matches a given regular expression. ๐
Usage:
$0 ~ regex
Parameters:
cdp[0]โ holds a reference to a regular expression.
Returns 1 in sp[0] if $0 matches the regular expression, 0 otherwise.
๐ง match1
Tests if a given expression matches a given regular expression. ๐
Usage:
expression ~ regex
Parameters:
cdp[0]โ holds a reference to a regular expression.sp[0]โ holds an expression to test.
Returns 1 in sp[0] if the expression matches the regular expression, 0 otherwise.
๐ match2
Tests if an expression in sp[-1] matches the regular expression in sp[0]. Same slay as match1, just with the stack doing the heavy lifting. ๐ฆ
Usage:
expression ~ regex
Parameters:
sp[0]โ holds a reference to a regular expression.sp[-1]โ holds an expression to test.
Returns 1 in sp[0] if the expression matches the regular expression, 0 otherwise.
๐ธ mktime
Converts a date specification in systime format into a timestamp. Time-travel but make it code. โฐ
Usage:
mktime( string )
Parameters:
sp[0]โ holds the date-specification string
Returns the result in sp[0].
๐ mod
Computes the modulus/remainder with two operands. ๐
Usage:
first % second
Parameters:
sp[0]โ holds the second operandsp[-1]โ holds the first operand
Returns the remainder in sp[0].
๐ mod_asg
Assigns the modulus/remainder with two operands. Modulus, but make it an assignment. โจ
Usage:
first %= second
Parameters:
sp[0]โ holds the second operandcdp[0]โ holds the first operand
Returns the remainder in sp[0] as well as replacing the first value. ๐
โญ mul
Computes the product with two operands. Math is serving. ๐ฅ
Usage:
first * second
Parameters:
sp[0]โ holds the second valuesp[-1]โ holds the first value
Returns the product in sp[0].
๐ mul_asg
Assigns the product with two operands. ๐ซถ
Usage:
first *= second
Parameters:
sp[0]โ holds the second valuesp[-1]โ holds the first value
Returns the product in sp[0] as well as replacing the first value. ๐
๐ neq
Compares two values. โจ
Usage:
first != second
Parameters:
sp[0]โ is the second valuesp[-1]โ is the first value
Returns 1 in sp[0] if the values are not equal, otherwise 0.
๐ฆ next
Reads the next record and restarts pattern testing. Fresh start, no drama. ๐ธ
Usage:
next
Parameters:
- none
๐ง nextfile
Begins processing the next file listed on the command line. Onto the next one, bestie. ๐
Usage:
nextfile
Parameters:
- none
๐ nf_pushi
Pushes the number of fields (NF) onto the evaluation stack. ๐
Usage:
(internal state)
Parameters:
- none
๐ not
Computes a logical negation. Flip-the-vibe energy. ๐
Usage:
! value
Parameters:
sp[0]โ holds a value to negate.
Returns the result on the evaluation stack, i.e., 0 if the value is nonzero and 1 otherwise.
๐ซถ ol_gl
Reads into $0 using getline. ๐
Usage:
getline
Parameters:
- none
๐ธ ol_gl_nr
Reads into $0 using getline, and also updates NR and FNR. Double the bookkeeping, double the slay. ๐
Usage:
getline < file
Parameters:
- none
๐ omain
Starts executing the main section of the script, the bit that lives between BEGIN and END. ๐
Usage:
(internal state)
Parameters:
- none
๐ฆ pop
Pops the evaluation stack and discards the value. Bye, value. ๐
Usage:
(internal state)
Parameters:
- none
๐ pop_al
Finishes an array โinโ loop and deallocates the state information. Cleanup crew has arrived. ๐งน
Usage:
(internal state)
Parameters:
- none
โญ post_dec
Post-decrements a value. ๐
Usage:
value --
Parameters:
sp[0]โ holds the value to decrement
Returns the updated value in sp[0].
๐ฅ post_inc
Post-increments a value. โจ
Usage:
value ++
Parameters:
sp[0]โ holds the value to increment
Returns the updated value in sp[0].
๐ง pow
Computes the first value raised to the power of the second value. Glow-up math. ๐
Usage:
first ^ second
Parameters:
sp[0]โ holds the second valuesp[-1]โ holds the first value
Returns the result in sp[0].
๐ pow_asg
Assigns the first value raised to the power of the second value. Power move, saved right into the variable. ๐ช
Usage:
variable = first ^ second
Parameters:
cdp[0]โ is a reference to the variable which will be assigned the resultsp[0]โ holds the second valuesp[-1]โ holds the first value
๐ pre_dec
Pre-decrements a value. Subtract first, ask questions later. ๐
Usage:
-- value
Parameters:
sp[0]โ holds the value to decrement.
Returns the updated value in sp[0];.
๐ pre_inc
Pre-increments a value. Add first, glow later. โจ
Usage:
++ value
Parameters:
sp[0]โ holds the value to decrement.
Returns the updated value in sp[0];.
๐ซถ pusha
Pushes an array address onto the stack. ๐
Usage:
(internal state)
Parameters:
cdp[0]โ array reference follows the command.
Returns the array in sp[0].
๐ pushc
Pushes a data cell onto the evaluation stack. ๐
Usage:
(internal state)
Parameters:
cdp[0]โ is a reference to the data to push
Returns a reference to the result in sp[0].
๐ฆ pushd
Pushes a double floating value onto the evaluation stack. Precision, babe. ๐
Usage:
(internal state)
Parameters:
cdp[0]โ is a reference to the data to push
Returns a reference to the result in sp[0].
๐ธ pushi
Pushes the contents of the next referenced variable onto the evaluation stack. ๐
Usage:
(internal state)
Parameters:
cdp[0]โ is a reference to the data cell to copy.
Returns a reference to the result in sp[0].
๐ง pushint
Reserves the next slot on the evaluation stack and sets its type. ๐
Usage:
(internal state)
Parameters:
cdp[0]โ holds the type to set in the new slot, e.g., for data via I/O redirection
Returns a reference to the result in sp[0].
โญ pushs
Pushes a reference to a string value onto the evaluation stack. ๐ฌ
Usage:
(internal state)
Parameters:
cdp[0]โ holds a reference to the string value
Returns a reference to the result in sp[0].
๐ rand
Returns a random number between zero and one. Pure chaos, lowkey. ๐ฒ
Usage:
rand()
Parameters:
- none
Returns the result in sp[0].
๐ฅ range
Tests a range pattern: pat1, pat2 { action }. Start, stop, and do the thing in between. ๐ข
Usage:
(internal state)
Parameters:
cdp[0].opโ a flag, testpat1if on elsepat2cdp[1].opโ offset ofpat2code fromcdpcdp[2].opโ offset of action code fromcdpcdp[3].opโ offset of code after the action fromcdpcdp[4]โ start ofpat1codesp[0]โ holds arguments for the action.
๐ซถ ret
Returns a function value. And that's the tea. โ
Okay so the ret body is still going, and we're bestie-level obsessed with how mawk handles this ๐
Usage:
return value
sp[0]โ holds the return value ๐
When a function gets called, mawk saves the current stack and makes a fresh one โจ On return, it restores the previous stack and hands back the function value in sp[0] ๐ฆ
โจ ret0 โจ
Return from a function with no return value at all ๐
Usage:
return
sp[0]โ gets modified so the value is uninitialized ๐ซถ
Just like the ret operation, mawk restores the previous stack ๐ธ After the return, sp[0] is an uninitialized value, so no cap, treat it with care ๐
โจ set_al โจ
This one begins an array "in" loop ๐
Usage:
for ( iterator in arrayname ) statement
sp[0]โ holds a reference to the array ๐งsp[-1]โ holds a reference to the iteration variable ๐
Mawk pushes a brand new entry onto the array loop stack, and updates cdp so it points at the statement to run next ๐
โจ sin โจ
Computes the sine of a value in radians ๐
Usage:
sin( value )
sp[0]โ holds the value ๐
Returns the result in sp[0] ๐
โจ sprintf โจ
Returns a string built from the expression-list according to the format ๐
Usage:
sprintf( format [, value1 [,... ] ] )
sp[0]โ is the last parameter value, and you can have up to 255 of them ๐
Returns the resulting string in sp[0] โจ
โจ sqrt โจ
Returns the square root of a value ๐
Usage:
sqrt( value 0
sp[0]โ is the value ๐ฆ
Returns the result in sp[0] ๐
โจ srand โจ
Seeds the random number generator ๐ฒ
Usage:
srand( value )
srand( )
sp[0]โ is the seed value, and it's allowed to be uninitialized ๐ซถ
Returns the previous seed value in sp[0] ๐ฅ
โจ stop โจ
Finishes a range pattern ๐
Usage:
(internal state)
- none ๐
โจ strftime โจ
Formats the given timestamp using the given format ๐ฐ๏ธ
Usage:
strftime( format , timestamp , utc )
strftime( format , timestamp )
strftime( format )
strftime( )
Zero to three parameters can be on the stack. If all three get used, here's the lineup ๐
sp[0]โ is the utc flag ๐ธsp[-1]โ is the timestamp value ๐งsp[-2]โ is the format ๐
Returns the result in sp[0] ๐
โจ sub โจ
Subtracts the second value from the first ๐ฐ
Usage:
first - second
sp[0]โ holds the second value ๐ซถsp[-1]โ holds the first value ๐
Returns the result in sp[0] โจ
โจ sub_asg โจ
Assigns the difference of two values to a variable ๐
Usage:
target = first - second
cdp[0]โ holds a reference to the variable where the result gets assigned ๐ฆsp[0]โ holds the second value ๐sp[-1]โ holds the first value ๐
Stores the difference in the target, and leaves sp[0] pointing to the target ๐
โจ substr โจ
eturns the substring of string s, starting at index i, with length n ๐ซ
Usage:
substr(s,i,n)
substr(s,i)
Two or three parameters can be on the stack. If all three get used, they go like this ๐ธ
sp[0]โ holds the lengthn. ๐sp[0]โ holds the indexi. ๐งsp[0]โ holds the strings. ๐
โจ system โจ
Runs a command and returns the wait-status ๐ฅ๏ธ
Usage:
status = system( command )
sp[0]โ is the command to execute ๐ฅ
Returns the wait-status in sp[0] โจ
โจ systime โจ
Returns the current time of day as the number of seconds since the Epoch โฐ
Usage:
systime( )
- none ๐ฆ
Returns the result in sp[0] ๐
โจ test โจ
Tests a logical expression ๐งช
Usage:
value
sp[0]โ holds a value to test ๐ซถ
Returns the result on the evaluation stack, so it's 1 if the value is nonzero and 0 otherwise ๐
โจ tolower โจ
Copies a string and converts it to lowercase ๐ก
Usage:
tolower( value )
sp[0]โ is the value to convert ๐ธ
Returns the result in sp[0] ๐
โจ toupper โจ
Copies a string and converts it to uppercase ๐
Usage:
toupper( value )
sp[0]โ is the value to convert ๐
Returns the result in sp[0] ๐
โจ uminus โจ
Unitary minus, aka flipping the sign ๐
Usage:
- value
sp[0]โ contains a value to negate. As a side effect, if the value is a string, it gets cast to double floating point. โก
Returns the result in sp[0] ๐
โจ uplus โจ
Unitary plus ๐
Usage:
+ value
sp[0]โ contains a value to use. As a side effect, if the value is a string, it gets cast to double floating point. ๐ฆ
Returns the result in sp[0] โจ
๐ REGULAR EXPRESSIONS ๐
โจ M_1J โจ
mandatory jump ๐
โจ M_2JA โจ
optional (undesirable) jump ๐
โจ M_2JB โจ
optional (desirable) jump ๐
โจ M_2JC โจ
pop position, optional jump (to continue looping) if advanced ๐
โจ M_ACCEPT โจ
end of match ๐
โจ M_ANY โจ
arbitrary character (.) ๐ฏ
โจ M_CLASS โจ
character class ๐งฉ
โจ M_END โจ
end of string ($) ๐
โจ M_ENTER โจ
prepares an iteration by resetting the counter. This comes right before an M_SAVE_POS ๐ง
โจ M_LOOP โจ
Like M_2JC, this is the last part of a conditional loop. It's used where one or both of the minimum and maximum iterations are known ๐
โจ M_SAVE_POS โจ
pushes the position onto the stack, at the beginning of a loop ๐
โจ M_START โจ
start of string (^) ๐ฌ
โจ M_STR โจ
matching a literal string ๐
โจ M_U โจ
arbitrary string (.*) ๐
That's the whole page, bestie! ๐ฆ mawk-code(7), v1.3.4, last glow-up 2025-01-30 ๐ Slay forever ๐โจ
๐ฆ where this page comes from
- alpine 3.23: mawk-doc 1.3.4_p20250131-r0 ยท GPL-2.0-only
- alpine 3.24: mawk-doc 1.3.4_p20260302-r0 ยท GPL-2.0-only
- debian trixie: mawk 1.3.4.20250131-1 ยท GPL-2.0-only
- epel 10: mawk 1:1.3.4-4.20250131.el10_1 ยท GPL-2.0-only
- epel 9: mawk 1:1.3.4-4.20250131.el9 ยท GPL-2.0-only
- fedora 43: mawk 1:1.3.4-5.20250131.fc43 ยท GPL-2.0-only
- fedora 44: mawk 1:1.3.4-6.20260129.fc44 ยท GPL-2.0-only
- fedora 44: mawk 1:1.3.4-7.20260302.fc44 ยท GPL-2.0-only
- ubuntu questing: mawk 1.3.4.20250131-1 ยท GPL-2.0-only
- ubuntu resolute: mawk 1.3.4.20260129-1 ยท GPL-2.0-only
- ubuntu stonking: mawk 1.3.4.20260302-1 ยท GPL-2.0-only
- copyright 2020-2024,2025 Thomas E. Dickey
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms