view bin/slashlearn @ 6064:c7c88d1812eb

<ais523> ` chmod a+x bin/asm
author HackBot
date Fri, 16 Oct 2015 22:36:32 +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»"