I for some reason can't figure this out. I need the following to look like this. I basically don't want to write the same command 20-50 times depending or even more. Thanks!
The problem with the current loop below is that the vars ${NETWORKNAME,,} inside the string in the command return an empty string. Example
docker exec cli.Amazon bash -c 'peer channel create -c asus -f ./channels/Asus.tx -o orderer..com:7050'
Which is obviously not a correct command
What I'm looking for
docker exec cli.Amazon bash -c 'peer channel create -c asus -f ./channels/Asus.tx -o orderer.pcexchange.com:7050'
Current code
#!/bin/bash
NETWORKNAME=PCEXCHANGE
VERSION=1.1.0
ORGANIZATIONS=( "Asus" "Dell" "HP" "Amazon" )
PRODUCERS=( "Asus" "Dell" "HP" )
MAKERS=( "Amazon" )
for org in ${PRODUCERS[@]}
do
for maker in ${MAKERS[@]}
do
docker exec cli.${maker} bash -c 'peer channel create -c ${org,,} -f ./channels/${org}.tx -o orderer.${NETWORKNAME,,}.com:7050'
done
done