![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Jun 2005
Location: Texas
Posts: 3
Rep Power: 0
![]() |
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 |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|