Mercurial > repo
view bin/slashlearn @ 11301:6fae3200f233
<int-e> ` mv {bin,lib}/morse-decode; echo \'#!/hackenv/bin/shebang_args_or_input /hackenv/lib/morse-decode\' > bin/morse-decode; chmod +x bin/morse-decode
author | HackBot |
---|---|
date | Thu, 04 Jan 2018 23:48:26 +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&.')"