view bin/learn_append @ 4952:c59c43efc84d

<oerjan> sed -i "4ised -i \'y/"\'\\\\n\'"/ /"\'wisdom/$topic\' bin/learn_append
author HackBot
date Tue, 30 Sep 2014 05:51:08 +0000
parents f843a1572d32
children cac1ae3999eb
line wrap: on
line source

#!/bin/bash
topic=$(echo "$1" | lowercase | sed 's/^\(an\?\|the\) //;s/s\? .*//')
stuff=$(echo "$1" | cut -d' ' -f2-)
sed -i 'y/\n/ /wisdom/$topic
echo "$stuff" >>"wisdom/$topic"
echo "I knew that."