Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
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
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:33 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC