view bin/learn_append @ 6471:6fa2991985ad

<izabera> ` sed -i s/!// bin/2015
author HackBot
date Thu, 31 Dec 2015 20:32:45 +0000
parents 38b26e48d344
children
line wrap: on
line source

#!/bin/bash
topic="$(echo "$1" | lowercase | sed 's/^\(an\?\|the\) //;s/s\? .*//')"
stuff=$(echo "$1" | cut -d' ' -f2-)
perl -i -p -e 's/\n/ /' "wisdom/$topic"
echo "$stuff" >>"wisdom/$topic"
echo -n "Learned '$topic': "
cat "wisdom/$topic"