Mercurial > repo
changeset 6452:07e92c85b28c
<oerjan> ` cat le/rn bin/learn_append | sed \'6,9d;s/value/stuff/\' >le/rn_append; chmod +x le/rn_append
author | HackBot |
---|---|
date | Tue, 22 Dec 2015 18:32:48 +0000 |
parents | 06d389231d96 |
children | 81effbbe0ff9 |
files | le/rn_append |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/le/rn_append Tue Dec 22 18:32:48 2015 +0000 @@ -0,0 +1,9 @@ +#!/bin/bash +[[ "$1" = */* ]] || exit +topic=$(echo "$1" | lowercase | cut -d / -f 1) +[ -z "$topic" ] && exit 1 +stuff=$(echo "$1" | cut -d / -f 2-) +perl -i -p -e 's/\n/ /' "wisdom/$topic" +echo "$stuff" >>"wisdom/$topic" +echo -n "Learned '$topic': " +cat "wisdom/$topic"