On Fri, 6 Feb 2015 13:42:45 -0500, Walter Dnes wrote:
> #!/bin/bash
> xdate=`date +d`
> if [ "10#${xdate}" -le 7 ]; then
> do_whatever
> fi
>
> 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.
--
Neil Bothwick
The horizon of many people is a circle with a radius of zero. They call
this their point of view.
-- Albert Einstein
pgpnWWtJlMGmL.pgp
Description: OpenPGP digital signature

