view bin/learn @ 8752:25c26dcdd1df

<oerjan> sled bin/learn//s,[>].wisdom..topic.,>"$(echo-p "wisdom/$topic")",
author HackBot
date Wed, 06 Jul 2016 01:02:30 +0000
parents 8a4daea2a8de
children
line wrap: on
line source

#!/bin/bash
topic=$(echo "$1" | lowercase | sed 's/^\(an\?\|the\) //;s/s\?[:;,.!?]\? .*//')
[ -e "wisdom/$topic" ] && verb="Relearned" || verb="Learned"
echo "$1" >"$(echo-p "wisdom/$topic")"
echo "$verb '$topic': $1"