5.5
Recipes
Preface
Iterate from 1 to n
Iterate over a list
Generate a list of numbers
Capture text output from a shell command
Compile and execute a string containing Mythryl source code
Look up a key in the linux environment
Print the script’s commandline arguments
Compute the length of a string
Compute the length of a list
Read an int from a string
Read a float from a string
Read multiple numbers from a string
Round a float to an int
Sort a list of strings
Sort a list of integers
Sort a list of floats
Sort a list of tuples or records
Sort a list of strings, dropping duplicates
Sort a list of integers, dropping duplicates
Sort a list of floats, dropping duplicates
Concatenate two lists
Reverse a list
Shuffle a list pseudo-randomly
Get first element of list (Lisp
CAR
)
Get rest of list (Lisp
CDR
)
Prepend element to list (Lisp
CONS
)
Select first/second element of each of a list of pairs
Drop the first N characters of a string
Drop last N characters of a string
Extract a substring of string
Explode a string into a list of characters
Implode a list of characters into a string
Reverse a string
Force a string to upper case
Force a string to lower case
Force a list of strings to upper case
Concatenate two strings
Concatenate a list of strings
Concatenate a list of strings, with a given separator
Break a string into whitespace-separated words
Break a string into colon-separated fields:
Break some text into lines
Regular expressions
Read a text file
Write a text file
Append text to a file
Filter a text file
Delete a file
Rename a file
Check File Existence
Check File Readability
Get the size of a file
Set file mode
Get current directory
Process contents of directories and directory trees
Run a long-lived Linux subprocess
Count the number of cores available on host
Set the exit status of a Mythryl script or program
Comments and suggestions to:
bugs@mythryl.org