Well... it's hard to give an example without knowing how the text file looks like.
But, if it were me, I would read the text file (probably using a
while loop), look for the string
I would then save the port (in this example 8080) and use
sed to replace the current port in the Apache config file with the port we get from the text file.
Best regards,
HMW