|
From: Thomas S. <t.s...@fz...> - 2009-11-23 14:40:12
|
you get what you request ;-)
`date -d "-$(($(date +%d)-1)) days" +%Y-%m-%d`
gives
2009-11-01
and
FIRST_DAY=2009-11-01
is
2009 - 11 - 1 = 1997
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`"
FlavioB wrote:
>
>> FIRST_DAY=`date -d "-$(($(date +%d)-1)) days" +%Y-%m-%d`
>> LAST_DAY=`date -d "+1 month -$(date +%d) days" +%Y-%m-%d`
>
> I just discovered that it doesn't assign correctly the value I want, in
> gnuplot:
>
> gnuplot> FIRST_DAY=`date -d "-$(($(date +%d)-1)) days" +%Y-%m-%d`
> gnuplot> print FIRST_DAY
> 1997
>
> While at the usual bash prompt I get:
>
> storebox:~# date -d "-$(($(date +%d)-1)) days" +%Y-%m-%d
> 2009-11-01
>
> How come?
>
> Thanks,
> 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...
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Gnuplot-info mailing list
> Gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
>
--
View this message in context: http://old.nabble.com/set-xrange-from-variable-tp26477602p26479233.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|