[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] bash question



Question for the bash gurus:

I am wondering why I get the following different output from two different
bash operations.

Lets say I have a file called t1.txt, and it contains the following line:

This is line1
This is line2
This is line3

If I give the bash command cat t1.txt, I get the following

This is line1
This is line2
This is line3

However, if I do:

for f in `cat t1.txt` ; do echo $f ; done

I get the following

This 
is 
line1
This 
is 
line2
This 
is 
line3

etc.

Any hints on combining the cat command with the for command, and have the
output look like:

This is line1
This is line2
This is line3

Thanks in advance for any assistance

Regards - Bob