Mercurial > repo
changeset 6661:556bd058172e
<oerjan> ` sed -i \'s!wisdom/[^"]*"!$(echo-p "wisdom/$key")"!\' bin/slashlearn
author | HackBot |
---|---|
date | Tue, 09 Feb 2016 01:16:09 +0000 |
parents | d5e6f3938ac8 |
children | cde789c3b6c0 |
files | bin/slashlearn |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/slashlearn Tue Feb 09 01:15:42 2016 +0000 +++ b/bin/slashlearn Tue Feb 09 01:16:09 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")" && echo "Learned «$key»"