view bin/learn_append @ 8021:f5db21202980

<shachaf> le/rn lem/Stanis\xc5\x82aw Lem was a Polish logician who discovered the law of excluded middle.
author HackBot
date Wed, 11 May 2016 03:31:53 +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"