Mercurial > repo
changeset 4965:73e248293897
<oerjan> sed -i "4iperl -i -p -e \'s/\\n/ /\' "\'"wisdom/$topic"\' bin/learn_append # from stackoverflow
author | HackBot |
---|---|
date | Tue, 30 Sep 2014 06:10:04 +0000 |
parents | fd2b9bd218db |
children | 868dd7ee44b5 |
files | bin/learn_append |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/learn_append Tue Sep 30 06:08:53 2014 +0000 +++ b/bin/learn_append Tue Sep 30 06:10:04 2014 +0000 @@ -1,5 +1,7 @@ #!/bin/bash topic=$(echo "$1" | lowercase | sed 's/^\(an\?\|the\) //;s/s\? .*//') stuff=$(echo "$1" | cut -d' ' -f2-) +perl -i -p -e 's/ +/ /' "wisdom/$topic" echo "$stuff" >>"wisdom/$topic" echo "I knew that."