view bin/slashlearn @ 9994:d8734db325b9

<hppavilion[1]> le/rn Rogue One//Any regular who gives the slightest Rogue One spoiler shall be hunted down in real life and have their intestines removed through their eye sockets. Members would not be exempt if they existed, which they don\'t.
author HackBot
date Sat, 17 Dec 2016 23:40:13 +0000
parents 68aaf05e3aec
children 7d14a8891360
line wrap: on
line source

sep="//"
[[ "$1" == ?*"$sep"* ]] || { echo 'All le//rn variants now use two slashes in the format.' >&2 ; exit 1; }
key="$(echo "${1%%$sep*}" | lowercase)"
value="${1#*$sep}"
[ -e "wisdom/$key" ] && verb="Relearned" || verb="Learned"
echo "$value" > "$(echo-p "wisdom/$key")" && echo -n "$verb '$key': $(echo "$value" | sed 's.^[ ].0,04&.')"