Does anyone know how to assign each line of a text file to a string variable in a bash script?
I tried the following:
for x in $(cat ./filename)
do
echo $x
done
What happened is that it assigned each word instead of each line in the file to the variable.