Newsgroups: comp.unix.wizards
Path: utzoo!utgpu!watserv1!dmcanzi
From: dmcanzi@watserv1.waterloo.edu (David Canzi)
Subject: Re: Cron - First Saturday of the month
Message-ID: <1990Aug11.030818.28876@watserv1.waterloo.edu>
Organization: People's Democratic Republic of Uniwat
References: <19744@orstcs.CS.ORST.EDU> <1990Aug8.185745.16606@iwarp.intel.com> <1990Aug8.214539.1264@watserv1.waterloo.edu>
Date: Sat, 11 Aug 90 03:08:18 GMT
Lines: 15

In article <1990Aug8.214539.1264@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
