Mercurial > repo
view bin/slashlearn @ 11000:ce903bef1a4b
<hppavilion[1]> le/rn Russell\'s Teapot//Russell\'s little Teapot / Short and stout / Orbits near Mars / Or thereabout. / If you see it / Let us know / If you don\'t / What does that show?
author | HackBot |
---|---|
date | Sat, 03 Jun 2017 08:14:52 +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&.')"