I am learning bash scripting and I have this script:
#!/bin/sh
while read line; do
for word in $line; do
echo "word = '$word'"
done
done <"words.txt"
and here are the contents of words.txt
ddddd g
eeee fffffff
Here is the output:
word = 'ddddd'
'ord = 'g
word = 'eeee'
'ord = 'fffffff
What is going on with the output on line 2 and 4? Why is it not print word = 'g' ?
I am using cmder-mini on windows.
thank you.