view bin/learn_append @ 4958:52a7f7c9dc4f

<oerjan> sed -i "4iperl -i -p -e \'s/\\n//\' "\'"wisdom/$topic"\' bin/learn_append # from stackoverflow
author HackBot
date Tue, 30 Sep 2014 06:05:27 +0000
parents b59cee31b658
children 08f4d34ddc3b
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/
//' "wisdom/$topic"
echo "$stuff" >>"wisdom/$topic"
echo "I knew that."