Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] cron - once a month during week days
Date: Fri, 06 Feb 2015 22:58:04
Message-Id: 20150206225749.72dffc43@digimed.co.uk
In Reply to: Re: [gentoo-user] cron - once a month during week days by Walter Dnes
1 On Fri, 6 Feb 2015 13:42:45 -0500, Walter Dnes wrote:
2
3 > #!/bin/bash
4 > xdate=`date +d`
5 > if [ "10#${xdate}" -le 7 ]; then
6 > do_whatever
7 > fi
8 >
9 > Note a booby trap here. `date +d` returns a 2-digit number, padded
10 > with a leading zero if necessary.
11
12 Use "date +%e", which uses a space instead of a zero to pad single digit
13 dates.
14
15
16 --
17 Neil Bothwick
18
19 The horizon of many people is a circle with a radius of zero. They call
20 this their point of view.
21 -- Albert Einstein