From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id D756C138A1A for ; Fri, 6 Feb 2015 22:58:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 38F5BE0A5F; Fri, 6 Feb 2015 22:58:01 +0000 (UTC) Received: from mail.digimed.co.uk (82-69-83-178.dsl.in-addr.zen.co.uk [82.69.83.178]) by pigeon.gentoo.org (Postfix) with ESMTP id EF2ECE0A43 for ; Fri, 6 Feb 2015 22:57:59 +0000 (UTC) Received: from digimed.co.uk (shooty.digimed.co.uk [192.168.1.8]) by mail.digimed.co.uk (Postfix) with ESMTPA id B5B6721955 for ; Fri, 6 Feb 2015 22:57:58 +0000 (GMT) Date: Fri, 6 Feb 2015 22:57:49 +0000 From: Neil Bothwick To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] cron - once a month during week days Message-ID: <20150206225749.72dffc43@digimed.co.uk> In-Reply-To: <20150206184245.GA17119@waltdnes.org> References: <20150205191913.GA29686@syscon7> <20150206184245.GA17119@waltdnes.org> Organization: Digital Media Production X-Mailer: Claws Mail 3.11.1-67-g87ab2b (GTK+ 2.24.25; x86_64-pc-linux-gnu) X-GPG-Fingerprint: 7260 0F33 97EC 2F1E 7667 FE37 BA6E 1A97 4375 1903 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/PqpLE/NPL8zXLwhRSBzc4C3"; protocol="application/pgp-signature" X-Archives-Salt: 78d0881d-448b-4d34-a212-9c681bd5ed99 X-Archives-Hash: 55c425337a173f0d4681ca5e7869d6af --Sig_/PqpLE/NPL8zXLwhRSBzc4C3 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 6 Feb 2015 13:42:45 -0500, Walter Dnes wrote: > #!/bin/bash > xdate=3D`date +d` > if [ "10#${xdate}" -le 7 ]; then > do_whatever > fi >=20 > Note a booby trap here. `date +d` returns a 2-digit number, padded > with a leading zero if necessary. Use "date +%e", which uses a space instead of a zero to pad single digit dates. --=20 Neil Bothwick The horizon of many people is a circle with a radius of zero. They call this their point of view. -- Albert Einstein --Sig_/PqpLE/NPL8zXLwhRSBzc4C3 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlTVRvYACgkQum4al0N1GQOLCQCgpJQs/NjAZ5gEQZZbyAnglQkD MYcAoIYGJZFSdgK34Z3TgiclkAgjkV0p =F2jB -----END PGP SIGNATURE----- --Sig_/PqpLE/NPL8zXLwhRSBzc4C3--