Mercurial > repo
annotate bin/learn_append @ 6501:6ca43f5f4d7d
<Melvar> ` sed -i -e \'s/inp[)]$/unicode(inp, locale.getpreferredencoding())).encode(locale.getpreferredencoding())/\' -e \'2s/$/, locale/\' bin/loudly
author | HackBot |
---|---|
date | Sun, 03 Jan 2016 11:48:31 +0000 |
parents | 38b26e48d344 |
children |
rev | line source |
---|---|
5643 | 1 #!/bin/bash |
6445
38b26e48d344
<olsner> ` sed -i \'/^topic/ s/\\$.*$/"&"/\' bin/learn_append
HackBot
parents:
5643
diff
changeset
|
2 topic="$(echo "$1" | lowercase | sed 's/^\(an\?\|the\) //;s/s\? .*//')" |
5643 | 3 stuff=$(echo "$1" | cut -d' ' -f2-) |
4 perl -i -p -e 's/\n/ /' "wisdom/$topic" | |
5 echo "$stuff" >>"wisdom/$topic" | |
6 echo -n "Learned '$topic': " | |
7 cat "wisdom/$topic" |