view bin/learn_append @ 4936:e0f2e3b3a5b9

<oerjan> sed -i -e \'4afmt -w1000 "wisdom/$topic"\' -e \'s/[$]stuff/ $stuff/\' bin/learn_append
author HackBot
date Tue, 30 Sep 2014 00:12:07 +0000
parents 9e1eab34dcfe
children 71e7f7d66f28
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 -w1000 "wisdom/$topic"
echo "I knew that."