Mercurial > repo
view bin/slashlearn @ 9943:17c0775fb9bc
<boily> le/rn fat//Fats are one of the four basic classes of nutrients. The other three are sugars, coffee and alcohol.
author | HackBot |
---|---|
date | Sun, 11 Dec 2016 19:43:51 +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&.')"