![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| joining command results, and substitution | ncatdesigner | Shell Programming and Scripting | 6 | 04-17-2008 08:37 AM |
| Formatting Substitution Command Not Working in vi | ERPKEN | UNIX for Advanced & Expert Users | 11 | 05-06-2007 06:36 PM |
| complex command substitution | spopuri | Shell Programming and Scripting | 5 | 05-24-2006 05:37 AM |
| command substitution problems with csh using grep | voodoo31 | Shell Programming and Scripting | 2 | 01-14-2006 04:39 AM |
| Substitution of last command | ghazi | Shell Programming and Scripting | 6 | 01-16-2005 04:06 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
How about
Code:
echo "$bt" |
||||
| Google The UNIX and Linux Forums |