Mercurial > repo
changeset 12187:652d1c5a24be draft
<fizzie> ` mv /hackenv/le/rn_append /hackenv/bin/slashlearn_append && ln -sf /hackenv/bin/slashlearn_append /hackenv/le/rn_append # let\'s make that consistent
author | HackEso <hackeso@esolangs.org> |
---|---|
date | Sun, 24 Nov 2019 16:31:16 +0000 (2019-11-24) |
parents | 1687b4cdce7a |
children | 12380d158809 |
files | bin/slashlearn_append le/rn_append |
diffstat | 2 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/slashlearn_append Sun Nov 24 16:31:16 2019 +0000 @@ -0,0 +1,8 @@ +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"
--- a/le/rn_append Sun Nov 24 16:25:43 2019 +0000 +++ b/le/rn_append Sun Nov 24 16:31:16 2019 +0000 @@ -1,8 +1,1 @@ -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" +/hackenv/bin/slashlearn_append \ No newline at end of file