I am trying to export some path names based on text in a text file however I am having some trouble,
file="config.txt"
while read line
do
LINE= "$line"
echo "$line"
done <"$file"
export LINE
I have tried using the above code but it does not save the String in config.txt to LINE. Any suggestions would be great!!
I think you need to eliminate the spaces around the assignment operator:
Also, the script will only save the last line from your file into the variable. All previous lines will be overwritten as the code loops.