view bin/slashlearn_append @ 12300:a20d4132c6b4 draft

<oerjan> le/rn_append zemhill//See http://zem.fi/bfjoust/ for more information.
author HackEso <hackeso@esolangs.org>
date Tue, 07 Jan 2020 07:35:11 +0000
parents 652d1c5a24be
children
line wrap: on
line source

sep="//"
[[ "$1" == ?*"$sep"* ]] || exit 1
topic="$(echo "${1%%$sep*}" | lowercase)"
stuff="${1#*$sep}"
perl -i -p -e 's/\n/ /' "${HACKENV-/hackenv}/wisdom/$topic"
echo "$stuff" >>"${HACKENV-/hackenv}/wisdom/$topic"
echo -n "Learned '$topic': "
cat "${HACKENV-/hackenv}/wisdom/$topic"