Generate a random text from the expression.
$ rant
8gYmRa3F
$ rant -e'\(/-_-\)/ < [x_]{20}'
(/-_-)/ < xx__xxxxx_x__xx__xxx
$ rant [<option(s)>] <expression-only-if-no-other-expression>
generate a random text from the expression
options:
-c, --count=N generate random text N times
-e, --expression=EXPR generate random text from EXPR
-s, --separator=SEP print SEP between the generated text
--help print usage and exit
expression-syntax:
\d digit character
\w alphanumeric character + "_"
\t tab character
\n newline character
[...] character list ([abc], [a-z] and [a-zA-Z] are supported)
\x escape x
{n,m} repeat n to m times (m is optional)
? same as {0,1}
(a|b) a or b
- Perl (5.8.0 or later)
- Copy
rant
into your$PATH
. - Make
rant
executable.
$ curl -L https://raw.githubusercontent.com/nil-two/rant/master/rant > ~/bin/rant
$ chmod +x ~/bin/rant
Note: In this example, $HOME/bin
must be included in $PATH
.
Generate random text N times (default: 1)
$ rant -c 3
L77fQz2T
yVuO0hQu
RnA5CsT2
Generate random text from EXPR (default: \w{8}) If this option specified, first arguments ignored.
$ rant -e'(Good morning|Hello|Good afternoon)'
Good afternoon
$ rant -e'1: \|{1,20}' -c5
1: ||||||||||||
1: |||||||||
1: |||
1: ||||||
1: ||||||||||||||||
Print SEP between the generated text (default: \n)
$ rant -c5 -s,
8HurMlUi,0Avlt4JQ,WGxKzlE5,1blwOZJ2,LbiHLV3l
$ rant -e'([01](,[01]){2})' -c5 -s/
1,1,0/1,1,0/0,0,0/1,1,0/1,0,1
Print usage and exit.
$ rant --help
(Print usage and exit)
MIT License
nil2 [email protected]