view bin/slashlearn @ 5926:6dd8dc594e3c

<dipperswett> echo -e \'\\x034,9S\\x039,4T\\x034,9O\\x039,4P\\x034,9 \\x039,4T\\x034,9H\\x039,4E\\x034,9 \\x039,4M\\x034,9A\\x039,4D\\x034,9N\\x039,4E\\x034,9S\\x039,4S\' > madness
author HackBot
date Fri, 28 Aug 2015 13:42:48 +0000
parents 9c603f748542
children 73ffca368bac
line wrap: on
line source

#!/bin/bash
[[ "$1" = */* ]] || exit
topic=$(echo "$1" | lowercase | cut -d / -f 1)
[ -z "$topic" ] && exit 1
value=$(echo "$1" | cut -d / -f 2-)
echo "$value" > wisdom/"$topic" && echo "Learned «$topic»"