view bin/learn_append @ 7341:d3c294a55f99

<zgrep> misle/rn @/|a+b@| = { \xe2\x88\x9a(a\xc2\xb2-b\xc2\xb2) if a\xc2\xb2-b\xc2\xb2 \xe2\x89\xa5 0 ; i\xe2\x88\x9a(a\xc2\xb2-b\xc2\xb2) if a\xc2\xb2-b\xc2\xb2 < 0 }
author HackBot
date Fri, 01 Apr 2016 04:25:49 +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"