Mercurial > repo
view bin/slashlearn @ 9515:9323eb89de86
<oerjan> sled bin/sedlast//s/; echo.*//
author | HackBot |
---|---|
date | Sat, 29 Oct 2016 19:36:49 +0000 |
parents | 7f38c3d1c3a5 |
children | eee3c706c9e7 |
line wrap: on
line source
sep="/" [[ "$0" == *//* ]] && sep="//" [[ "$1" == ?*"$sep"* ]] || 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&.')"