Mercurial > repo
comparison bin/learn_append @ 5045:84864da646b0
<oerjan> revert
author | HackBot |
---|---|
date | Fri, 10 Oct 2014 11:40:48 +0000 |
parents | 301d8fcdf2b3 |
children | b2d3e73889a9 |
comparison
equal
deleted
inserted
replaced
5044:301d8fcdf2b3 | 5045:84864da646b0 |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 topic=$(echo "$1" | lowercase | sed 's/^\(an\?\|the\) //;s/s\? .*//') | 2 topic=$(echo "$1" | lowercase | sed 's/^\(an\?\|the\) //;s/s\? .*//') |
3 stuff=$(echo "$1" | cut -d' ' -f2-) | 3 stuff=$(echo "$1" | cut -d' ' -f2-) |
4 perl -i -p -e 's/\n/ /' "wisdom/$topic" | 4 perl -i -p -e 's/\n/ /' "wisdom/$topic" |
5 echo "$stuff" >>"wisdom/$topic" | 5 echo "$stuff" >>"wisdom/$topic" |
6 echo -n "Learned '$topic': "\ncat "wisdom/$topic" | 6 echo "I knew that." |