help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] need help running a command from a bash script


From: Wood Peter
Subject: [Help-bash] need help running a command from a bash script
Date: Mon, 8 Aug 2016 13:03:33 -0700

Hi,

I have this command:

mycommand --option "var date1='2016-01-01T04:00:00.000Z',
date2='2016-08-08T04:00:00.000Z'"

I'd like to run this from a bash script where the date will be a variable:

date1value=`date --date=yesterday +%FT00:00:00.000Z`
date2value=`date --date=yesterday +%FT23:59:59.000Z`
mycommand --option "var date1=$date1value,date2=$date2value"

The above is not working because the single quotes are missing i.e.
date1='date1_value_goes_here'
Also I can't do date1='$date1value' either because $ can't be inside the
sigle quotes.

Any help is appreciated.

Thank you,

-- Peter


reply via email to

[Prev in Thread] Current Thread [Next in Thread]