I try to read the configuration file, and then put the “section” of the configurations in an array in the bash script, and then run the command and then go through the configs again, and continue to do this until the end of the configuration file.
Here is an example configuration file:
PORT = "5000"
USER = "nobody"
PATH = "1"
OPTIONS = ""
PORT = "5001"
USER = "nobody"
PATH = "1"
OPTIONS = ""
PORT = "5002"
USER = "nobody"
PATH = "1"
OPTIONS = ""
I want the bash script to read in the first "section", inject it into the script, and run the following:
scriptname -p $PORT -u $USER -P $PATH -o $OPTIONS
, , , "" , "" , , , :
scriptname -p $PORT -u $USER -P $PATH -o $OPTIONS
scriptname -p $PORT -u $USER -P $PATH -o $OPTIONS
scriptname -p $PORT -u $USER -P $PATH -o $OPTIONS
:
scriptname -p 5000 -u nobody -P 1 -o ""
scriptname -p 5001 -u nobody -P 1 -o ""
scriptname -p 5002 -u nobody -P 1 -o ""
.