view bin/slashlearn @ 10000:20ae0b28393e

<izabera> ` echo \'sed "s/./& /g;s/.*/20k&p/" <<< "$*" | dc\' > bin/unaryrpn; chmod +x bin/unaryrpm; unaryrpm 111+/
author HackBot
date Tue, 20 Dec 2016 23:17:40 +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&.')"