View Single Post
Old Jun 18th, 2005, 11:37 AM   #1
bryanlharris
Newbie
 
Join Date: Jun 2005
Location: Texas
Posts: 3
Rep Power: 0 bryanlharris is on a distinguished road
for, cat, and echo

This is something I am curious about. I tried these commands and
expected one behavior but received another. Can anyone explain
further?

Conditions:
I have a file on my computer with the following contents:
Now is the time
for all good men
to come to the aid
of their country.

Expected Behavior(this doesn't really happen, but I wish it did):
for i in `cat file_1`; do echo $i; done


Now is the time
for all good men
to come to the aid
of their country.

Actual Behavior(this is what really happens):
for i in `cat file_1'; do echo $i; done


Now
is
the
time
for
all
good
men
to
come
to
the
aid
of
their
country.

I just don't understand why it is putting each word on a different line. Can anyone acheive the expected behavior? What am I doing wrong?

-Bryan
bryanlharris is offline   Reply With Quote