a Python wrapper that works like AWK or rb command
$ seq 3 | opy '[math.sin(F1)]'
0.8414709848078965
0.9092974268256817
0.1411200080598672
- See EXAMPLES.md
The opy
file and its manual are copied to /usr/local/bin/
and /usr/local/share/man/man1/
respectively with the following command.
$ sudo make install
$ brew tap ryuichiueda/oneliner-python
$ brew install oneliner-python
--help
: show help-m <modules>
: load modules-s
: string mode- prohibit automatic number conversions.
-i, -o
: input/output field separator
$ echo '1,2,3,4,5' | opy -i , '[F2]'
2
$ echo '1,2,3,4,5' | opy -i , -o x '[F2,F3,F4]'
2x3x4
-I
: regex input field separator
$ echo a33b313c | tr ' ' , | opy -I '\d+' '[*F[1:]]'
a b c