Im trying to loop though a string with HTTP links inside and newlines, I want to loop over a line at a time.
At the moment I have
echo -e "$HTTP_LINKS" | while read HTTP_S_LINK ; do
TEST_STRING="test"
done
But this way I don't have access to the TEST_STRING out side the loop, which is what I want. I'm using the while loop so that it will loop though each newline in $HTTP_LINKS and not just the words in the string. (I don't want to use a for loop with IFS set to \n)
I thought maybe I could just do something like this
#!/bin/bash
while read HTTP_S_LINKS
do
TEST_STRING="test2"
done < $HTTP_LINKS
But of course this doesn't work as $HTTP_LINKS contains a string and not a link to a file.