annotate le/rn_append @ 9862:6cd17a5c5808

<oerjan> sled le/rn_append//5d
author HackBot
date Mon, 05 Dec 2016 02:16:20 +0000
parents 0356fbd182e8
children 42f2882255c3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9861
0356fbd182e8 <oerjan> ` ( head -4 bin/slashlearn | sed \'s/key/topic/;s/value/stuff/\'; tail -5 le/rn_append ) > le/rn_app; mv le/rn_app{,end}
HackBot
parents: 6452
diff changeset
1 sep="//"
0356fbd182e8 <oerjan> ` ( head -4 bin/slashlearn | sed \'s/key/topic/;s/value/stuff/\'; tail -5 le/rn_append ) > le/rn_app; mv le/rn_app{,end}
HackBot
parents: 6452
diff changeset
2 [[ "$1" == ?*"$sep"* ]] || exit 1
0356fbd182e8 <oerjan> ` ( head -4 bin/slashlearn | sed \'s/key/topic/;s/value/stuff/\'; tail -5 le/rn_append ) > le/rn_app; mv le/rn_app{,end}
HackBot
parents: 6452
diff changeset
3 topic="$(echo "${1%%$sep*}" | lowercase)"
0356fbd182e8 <oerjan> ` ( head -4 bin/slashlearn | sed \'s/key/topic/;s/value/stuff/\'; tail -5 le/rn_append ) > le/rn_app; mv le/rn_app{,end}
HackBot
parents: 6452
diff changeset
4 stuff="${1#*$sep}"
6452
07e92c85b28c <oerjan> ` cat le/rn bin/learn_append | sed \'6,9d;s/value/stuff/\' >le/rn_append; chmod +x le/rn_append
HackBot
parents:
diff changeset
5 perl -i -p -e 's/\n/ /' "wisdom/$topic"
07e92c85b28c <oerjan> ` cat le/rn bin/learn_append | sed \'6,9d;s/value/stuff/\' >le/rn_append; chmod +x le/rn_append
HackBot
parents:
diff changeset
6 echo "$stuff" >>"wisdom/$topic"
07e92c85b28c <oerjan> ` cat le/rn bin/learn_append | sed \'6,9d;s/value/stuff/\' >le/rn_append; chmod +x le/rn_append
HackBot
parents:
diff changeset
7 echo -n "Learned '$topic': "
07e92c85b28c <oerjan> ` cat le/rn bin/learn_append | sed \'6,9d;s/value/stuff/\' >le/rn_append; chmod +x le/rn_append
HackBot
parents:
diff changeset
8 cat "wisdom/$topic"