#!/bin/sh # avoid using : in the filename as will break usage within # $PATH etc., also in NFS automounts according to the Hickster. format="%Y-%m-%d" if [ "$1" = "-t" ]; then format="$format-%H%Mh%Ss" shift fi if [ $# != 0 ]; then echo "Usage: $0 [ -t ]" >&2 exit 1 fi date +"$format"