1

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!!

1 Answer 1

3

I think you need to eliminate the spaces around the assignment operator:

LINE="$line"

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.