Mercurial > repo
changeset 6659:505f4ce0d864
<oerjan> ` sed -i \'s!wisdom/.*"!$(echo-p "wisdom/$key")"!\' bin/slashlearn
author | HackBot |
---|---|
date | Tue, 09 Feb 2016 01:15:27 +0000 |
parents | c1477023c681 |
children | d5e6f3938ac8 |
files | bin/slashlearn |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/slashlearn Tue Feb 09 01:12:38 2016 +0000 +++ b/bin/slashlearn Tue Feb 09 01:15:27 2016 +0000 @@ -1,1 +1,1 @@ -sep="/"; [[ "$0" == *//* ]] && sep="//"; [[ "$1" == ?*"$sep"* ]] || exit 1; key="$(echo "${1%%$sep*}" | lowercase)"; value="${1#*$sep}"; echo "$value" > "wisdom/$key" && echo "Learned «$key»" +sep="/"; [[ "$0" == *//* ]] && sep="//"; [[ "$1" == ?*"$sep"* ]] || exit 1; key="$(echo "${1%%$sep*}" | lowercase)"; value="${1#*$sep}"; echo "$value" > "$(echo-p "wisdom/$key")"