![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Delete Multiple White Spaces | eja | UNIX for Dummies Questions & Answers | 6 | 04-18-2008 07:34 AM |
| How to write multiple echo statements in unix? | Shrutiduggal | Shell Programming and Scripting | 2 | 01-09-2007 04:27 AM |
| echo omits slash - how to avoid | tc.omkumar | Shell Programming and Scripting | 3 | 03-21-2006 04:53 PM |
| Nested Loop to Echo Multiple Arrays | yongho | Shell Programming and Scripting | 1 | 07-12-2005 12:35 PM |
| Problem with echo for var, padded with spaces | videsh77 | Shell Programming and Scripting | 2 | 05-26-2005 04:27 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
echo is suppressing multiple spaces.How to avoid it
I am reading a file and copying selected lines from the file into another using echo.
For eg: while read line do if ((some logic to determine whether I need to copy the current line to another file)) then echo $line > tempfile fi done<srcfile The problem I have is the data in the file is: 12345 bjhjhd sdjkfhkdsfjh fdsfsf sdfds 43214 hjhkjkj kjhkjhkhjhjknds jkjnkjnk jkokjlkj djjdfff sdfsdffdfgfgdfgfdf sdfsfsdfsgv dfsdfv each line has multiple spaces. After running the above piece of code tempfile is created as: 12345 bjhjhd sdjkfhkdsfjh fdsfsf sdfds 43214 hjhkjkj kjhkjhkhjhjknds jkjnkjnk jkokjlkj djjdfff sdfsdffdfgfgdfgfdf sdfsfsdfsgv dfsdfv echo is suppressing multiple spaces.. how to avoid it? Can you please help! Thanks in advance! |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|