view bin/learn_append @ 8897:c7b65d0fe2f2

<shachaf> ` ln -s relcome bin/\x0304w\x0308e\x0309l\x0311c\x0312o\x0313m\x0304e\x0f
author HackBot
date Thu, 04 Aug 2016 02:22:10 +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"