#! /bin/sh FILENAME="$1" echo $FILENAME echo "@started:$(date '+%Y-%m-%d')" >> "$FILENAME" if [ $# -eq 3 ] then printf "$3" >> "$FILENAME" fi mv {,qq\ }"$FILENAME"