|
From: Boniforti F. <fl...@pi...> - 2009-11-23 14:59:35
|
Hallo Thomas,
> you get what you request ;-)
That's for sure, as we're talking about computers ;-)
> `date -d "-$(($(date +%d)-1)) days" +%Y-%m-%d` gives
> 2009-11-01
Can you correct me if I'm wrong? It give 2009-11-01 because it evaluates
the first piece of code up to "%Y"? And then it takes "-%m" and "-%d" as
single numerical values?
[cut]
> you need to make clear that you expect a string:
> FIRST_DAY=system('date -d "-$(($(date +%d)-1)) days"
> +%Y-%m-%d') FIRST_DAY="`date -d "-$(($(date +%d)-1)) days" +%Y-%m-%d`"
Many many thanks, but as I'm curious and willing to learn some more:
what's the "system" word standing for?
And how do I use double-quotes and/or single-quotes (like in your second
example)?
Thanks again and kind regards,
Flavio Boniforti
PIRAMIDE INFORMATICA SAGL
Via Ballerini 21
6600 Locarno
Switzerland
Phone: +41 91 751 68 81
Fax: +41 91 751 69 14
URL: http://www.piramide.ch
E-mail: fl...@pi...
|