View Single Post
Old Jun 18th, 2005, 11:52 AM   #3
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Echo by default outputs a newline character at the end of what you input. According to the man page, you can use the -n option to prevent this. Try changing your second statement to "do echo -n $i;". Note however that spaces are removed when doing a for, so you will have to re-add them.

My solution which is likely against every bash coding guideline in existance:
 for i in $(cat cat_file_1); do echo -n $i; echo -n ' '; done; echo

The last echo is to add a newline to the end.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270

Last edited by Dameon; Jun 18th, 2005 at 11:58 AM.
Dameon is offline   Reply With Quote