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