[ale] bash question

Bob Kruger bkruger at mindspring.com
Sat Jun 12 13:24:14 EDT 1999


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






More information about the Ale mailing list