![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| joining command results, and substitution | ncatdesigner | Shell Programming and Scripting | 6 | 04-17-2008 11:37 AM |
| Formatting Substitution Command Not Working in vi | ERPKEN | UNIX for Advanced & Expert Users | 11 | 05-06-2007 09:36 PM |
| complex command substitution | spopuri | Shell Programming and Scripting | 5 | 05-24-2006 08:37 AM |
| command substitution problems with csh using grep | voodoo31 | Shell Programming and Scripting | 2 | 01-14-2006 07:39 AM |
| Substitution of last command | ghazi | Shell Programming and Scripting | 6 | 01-16-2005 07:06 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Preserving space during command substitution
Hi all,
I am caught up in a problem .... tried all possible ways i knew .. but ended up in big zero ... ;-( I have a file as below .. $ cat siv.txt 1234567890BF00522000095ibsadministrator@ae.ge.com ibsadministrator@ae.ge.com Note the spaces in between .... I am doing a cut on this .. $ head -1 siv.txt | cut -c 11- BF00522000095ibsadministrator@ae.ge.com ibsadministrator@ The spaces are preserved ... Well and good till here ... But I need to assign this output to a variable and still preserve the spaces in the output which I am not able to do .. $ bt=`head -1 siv.txt | cut -c 11-` $ echo $bt BF00522000095ibsadministrator@ae.ge.com ibsadministrator@ The spaces get truncated ... Pls help me here... Thanks in advance, SNS |