Generate flexible patterns on the shell
Fix rpm/deb package bug
Support Egison 4.1.2 (Many thanks @momohatt !)
bug fix.
egzact supports double quotation "
and backslash \
as any separators (for fs
, ofs
, ifs
, eor
, eos
).
$ seq 10 | flat ofs='\\"' 3
1\\"2\\"3
4\\"5\\"6
7\\"8\\"9
10
All the commands did not work with latest Egison version 3.6.3. From this version 1.3.0, egzact supports latest version of Egison as of November 2016.
subsets
command was abolishedsublist
and subset
were newly created.sublist
commandThis is same as old subsets
command.
It prints all the sublists of the input.
$ echo A B C D | sublist
A
A B
B
A B C
B C
C
A B C D
B C D
C D
D
subset
commandThis is new command. It prints all the "subsets" of the input.
$ echo A B C D | subset
A
B
C
D
A B
A C
B C
A D
B D
C D
A B C
A B D
A C D
B C D
A B C D
slit
Divide whole the inputs into given number of rows.
# Print A to Z with 3 rows.
$ echo {A..Z} | slit 3
A B C D E F G H I
J K L M N O P Q R
S T U V W X Y Z
# Each line's number of field is adjusted to be near each other as much as possible.
$ echo A B C D | slit 3
A B
C
D
$ seq $(awk 'END{print NR}' mytext) | slit 17 | awk '{print "sed -n "$1","$NF"p mytext > mytext."NR}'
sed -n 1,2p mytext > mytext.1
sed -n 3,4p mytext > mytext.2
sed -n 5,6p mytext > mytext.3
sed -n 7,8p mytext > mytext.4
sed -n 9,10p mytext > mytext.5
sed -n 11,12p mytext > mytext.6
sed -n 13,14p mytext > mytext.7
sed -n 15,15p mytext > mytext.8
sed -n 16,16p mytext > mytext.9
sed -n 17,17p mytext > mytext.10
sed -n 18,18p mytext > mytext.11
sed -n 19,19p mytext > mytext.12
sed -n 20,20p mytext > mytext.13
sed -n 21,21p mytext > mytext.14
sed -n 22,22p mytext > mytext.15
sed -n 23,23p mytext > mytext.16
sed -n 24,24p mytext > mytext.17
# Execute
$ seq $(awk 'END{print NR}' mytext) | slit 17 | awk '{print "sed -n "$1","$NF"p mytext > mytext."NR}' | sh