![]() |
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 |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| trim fields using sed | stonemonolith | Shell Programming and Scripting | 3 | 02-23-2009 04:16 PM |
| Trim inside awk | subin_bala | Shell Programming and Scripting | 3 | 05-06-2008 08:51 AM |
| trim lines | melanie_pfefer | Shell Programming and Scripting | 6 | 03-26-2008 07:25 AM |
| trim file | tungaw2004 | UNIX for Dummies Questions & Answers | 1 | 09-15-2007 06:05 AM |
| Trim | JWilliams | Shell Programming and Scripting | 4 | 04-24-2007 02:52 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Trim issue
Hi All,
I am using trim in my code.. ID_SA_SOURCE="`echo "$data" | cut -c17-34 | tr -s " "`" ID_SA_DEST="`echo "$data" | cut -c35-52 | tr -s " "`" echo"$ID_SA_SOURCE";"$ID_SA_DEST"; the output is 0608166896; 3001339; contains one whitespace between the two ..how can i remove that single white space ? Thnks |
|
||||
|
agreed, it's very unclear what you're wanting to do..2 things however,
tr is "translate charachters" not trim! the format you're using is not correct, you don't have double quotes formatted correctly."actually you don't have double-quotes. Code:
tr -s " "`" ## 3 quotes, not 4! you also might want to use the ascii equiv to "`" char or tr -s " " "\`" |
|
||||
|
That's because that's inside backticks which are inside double quotes. The final double quote goes with the starting quote right before the starting backquote.
|
| Sponsored Links | ||
|
|