view bin/learn_append @ 4934:9f07ce51c124

<oerjan> sed -i -e \'4afmt -w "wisdom/$topic"\' -e \'s/[$]stuff/ $stuff/\' bin/learn_append
author HackBot
date Tue, 30 Sep 2014 00:11:21 +0000
parents ea1a79eac3a3
children 9e1eab34dcfe
line wrap: on
line source

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