#!/bin/sh # create text, assemble html file, add to articles #web is a symlink to /home/philip/src/web/wittamore.com ROOT=/home/philip/web mkdir -p $ROOT/.tmp cd $ROOT/.tmp EDITFILE="middle.html" DATE=$(date +%Y-%m-%d) read -p "Enter title: " TITLE read -e -i "$DATE" -p "Enter date: " input read -p "Enter description: " DESCRIPTION ARTICLEDATE="${input:-$DATE}" YEAR=$(echo $ARTICLEDATE | cut -c 1-4) DEST="$ROOT/articles/$YEAR" echo "
ยง
' >> $ARTICLE mv $ARTICLE $DEST echo "saved as $DEST/$ARTICLE"