How to dynamically pass assetname

+1 vote
Hello. I am using shell scripts to invoke API and create assets. How do i dynamically pass the assetname to the api :

--try 1 :

assetname="testasset3"
multichain-cli demo2 issue 17eCmxydksUKYSstQgBt2UV9EcJqQsWA4pJ7HX '{"name":"`echo $assetname`","open":true}' 0 1

 

--try 2:

assetname="testasset3"
multichain-cli demo2 issue 17eCmxydksUKYSstQgBt2UV9EcJqQsWA4pJ7HX '{"name":"$assetname","open":true}' 0 1

 

Nothing works , please guide.
asked Mar 17, 2017 by anonymous

1 Answer

0 votes

Try this... (if you are in Windows)...

set assetname="testasset3"

multichain-cli chain2 issue 1GENUQPhHVLVU8foNZJJQ9BL9rP5e2cztVKUHj  "{\"name\":%assetname%, "open":true}" 0 1

{"method":"issue","params":["1GENUQPhHVLVU8foNZJJQ9BL9rP5e2cztVKUHj","{\"name\":
testasset3,open:true}",0,1],"id":1,"chain_name":"chain2"}

52ceab12fa292e211a43625bb04c0d58bce7de9a961a54eb1f4106ff131637e5

 

answered Mar 18, 2017 by saravana
...