monochromatic

monochromatic blog: http://blog.z3bra.org
git clone git://z3bra.org/monochromatic
Log | Files | Refs

commit 84d9da28eb3c7749bede1a3d3b34b93ced09f924
parent 842e902b3fd29475a99f48dc11a06dcff465216a
Author: z3bra <willy@mailoo.org>
Date:   Wed, 30 Apr 2014 11:45:29 +0200

Helper to add the last article to the index

Diffstat:
publi.sh | 23+++++++++++++++++++++++
1 file changed, 23 insertions(+), 0 deletions(-)

diff --git a/publi.sh b/publi.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +link=$(ls -l last.txt | sed 's^.*-> /') + +test -z "$EDITOR" && EDITOR=vi + +sed 2q last.txt > tmp.txt +sed -i "s(#)(${link/.txt/.html})" tmp.txt + +echo "input a small description of the article.." >> tmp.txt + +$EDITOR tmp.txt + +echo >> tmp.txt + +sed '' index.txt >> tmp.txt + +sed 10q tmp.txt + +echo -n 'Is everything okay? [N/y] ' +read choice + +test "$choice" = "y" && mv tmp.txt index.txt