view bin/slashlearn @ 12001:00218840bf5c draft

<wib_jonas> `` perl -pi -e \'s/^(url\\(1hackeso\\) -) .*/$1 print URL for a file in the hackenv hg repository and web access of the repository/\' share/whatis
author HackEso <hackeso@esolangs.org>
date Mon, 04 Nov 2019 12:21:00 +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&.')"