Mercurial > repo
diff misle/rn_append @ 6783:0c13247bfca4
<oerjan> ` mkdir misle; cp le/* misle; sed -i \'s/wisdom/tmflry/g\' misle/*
author | HackBot |
---|---|
date | Wed, 10 Feb 2016 06:06:12 +0000 |
parents | |
children | c6bb618e60e3 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/misle/rn_append Wed Feb 10 06:06:12 2016 +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/ /' "tmflry/$topic" +echo "$stuff" >>"tmflry/$topic" +echo -n "Learned '$topic': " +cat "tmflry/$topic"