Mercurial > repo
view bin/learn_append @ 7452:37d11d7eb9bd
<b_jonas> learn Macedonia is a country of which the United Nations denies the existance, just like Taiwan is.
author | HackBot |
---|---|
date | Sun, 17 Apr 2016 22:29:07 +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"