Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I pass a bash variable to curl?

Tags:

bash

curl

I'm having difficulty passing a bash variable to curl. My script is as follows:

now=$(date)

curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"importprivkey","params":["test",$now,false]}' -H 'content-type:text/plain;' http://chad:[email protected]:8332/

$now isn't passing to the curl string. What am I missing?

like image 739
Chad Ayers Avatar asked Sep 11 '25 02:09

Chad Ayers


1 Answers

SOLVED:

now=$(date)

curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"importprivkey","params":['"$var3"','"$now"',false]}' -H 'content-type:text/plain;' http://chad:[email protected]:8332/
like image 154
Chad Ayers Avatar answered Sep 13 '25 09:09

Chad Ayers