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 |