Hello all,

I have a problem, which I don't understand:

Here is my textfile "test.txt" with the following content:
Code:
hello_world 123
byebye_world 456
I wrote a script, to readout every line with a for-loop:
Code:
#!/bin/bash
for F in `<test.txt`; do
        echo "$F"
done
The output of the script is like this:
Code:
root@host1:/tmp> ./test.sh
hello_world
123
byebye_world
456
And here is my question: Why are the numbers on a separate line? I tried to delete newlines / carriage returns with the "tr"-command -> no success.

How can I read the textfile with a for-loop having the numbers on the same line as the text?

Any hints?

Thanks a lot.
Tom