Cron - First Saturday of the month

David Canzi dmcanzi at watserv1.waterloo.edu
Sat Aug 11 13:08:18 AEST 1990


In article <1990Aug8.214539.1264 at watserv1.waterloo.edu> I wrote:
>In a sh script, it can be done by:
>
>if [ `date | sed 's/^... ...  *\([^ ]*\) .*/\1/'` -le 7 ]; then
>	...
>fi

This is better done using awk:

if [ `date | awk '{print $3}'` -le 7 ]; then
	...
fi

-- 
David Canzi



More information about the Comp.unix.wizards mailing list