I'm trying to read a config file, and then place the "section" of configs into an array in a bash script, and then run a command off that, and then reitterate through the configs again, and continue to do this until the end of the config file.
Here's a sample config 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", bring it into the script, and run the following:
scriptname -p $PORT -u $USER -P $PATH -o $OPTIONS
HOWEVER, I want it to, based on how many "sections" there are in the config file, to take each iteration of a "section", and run the command with its corresponding configuration settings and apply it to the final command. So if it were to read in the config file from above, the output would be:
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
Which in turn would look like:
scriptname -p 5000 -u nobody -P 1 -o "" scriptname -p 5001 -u nobody -P 1 -o "" scriptname -p 5002 -u nobody -P 1 -o ""
Thanks in advanced.