Mercurial > repo
view bin/slashlearn @ 11086:df94eceb14f9
<oerjan> learn Cognac is named for its strong cognitive effects. Taneb invented it, then somehow managed to keep it off the illegal drugs list.
author | HackBot |
---|---|
date | Wed, 12 Jul 2017 00:00:42 +0000 |
parents | 7d14a8891360 |
children | 8c13cadf308f |
line wrap: on
line source
sep="//" [[ "$1" == ?*"$sep"* ]] || { echo 'Usage: `le/[/]rn <key>//<wisdom>' >&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&.')"