view bin/slashlearn @ 6291:f0abe1320ff3

<tswett> echo \'There is a way out. Finding it will be difficult. It may be the hardest thing you\'\\\'\'ve ever done. Find it anyway.\' > good/544
author HackBot
date Fri, 27 Nov 2015 01:45:53 +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»"