I'm trying to write a bash script that will read pairs of variables from the file and then uses them in a loop. i'm trying to use this
while read p; do $p; echo "$a and $b"; done < text.txt
with the text.txt containing the following:
a="teststring"; b="anothertest"
a="teststring1"; b="anothertest1"
a="teststring2"; b="anothertest2"
the output looks like that:
bash: a="teststring";: command not found
and
bash: a="teststring1";: command not found
and
I have found similar question command line arguments from a file content
But couldn't figure out how to apply the answers to my particular case. Thanks!