Reverse lines.
$ echo Hello World | rl
dlroW olleH
$ rl [<option(s)>] [<file(s)>]
reverse lines.
options:
-s, --separator=SEP separate each line by SEP
-i, --keep-indent keep indents of each line
--help print usage and exit
- Perl (5.8.0 or later)
- Copy
rlinto your$PATH. - Make
rlexecutable.
$ curl -L https://raw.githubusercontent.com/nil-two/rl/master/rl > ~/bin/rl
$ chmod +x ~/bin/rl
Note: In this example, $HOME/bin must be included in $PATH.
Separate each line by SEP. Default value is empty string.
$ echo foo,bar,baz
foo,bar,baz
$ echo foo,bar,baz | rl -s,
baz,bar,foo
Keep indents of each line. Default is disabled.
$ printf "%s\n" ' foo' 'bar' ' baz'
foo
bar
baz
$ printf "%s\n" ' foo' 'bar' ' baz' | rl -i
oof
rab
zab
Print usage and exit.
$ rl --help
(Print usage)
MIT License
nil2 nil2@nil2.org