![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| add carriage return at end of file | HAA | Shell Programming and Scripting | 2 | 11-20-2007 08:58 AM |
| Carriage Return at end of file | bd_joy | Shell Programming and Scripting | 14 | 10-20-2006 10:20 AM |
| How to delete carriage return in SED | stevefox | Shell Programming and Scripting | 3 | 12-23-2005 03:03 AM |
| Dont want carriage return | videsh77 | Shell Programming and Scripting | 3 | 12-16-2004 06:26 PM |
| Capture carriage return. | gio123bg | Shell Programming and Scripting | 4 | 12-15-2003 07:21 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Carriage return on long awk operation
hello all
I have long awk function that doing manipulations on text file but when I write the out put to new text file I have carriage return between 2 print commands How can I avoid this ? Here is my awk : echo $f | awk '{i=split($0,a,":");print"$idlServantsHash{'\''"a[1]":"a[2]"'\''}";j=split($0,b,"|");print"=""'\''"b[2]"'\''"}' the output is : $idlServantsHash('foo:foo') =('blah') I will like to avoid this line break . what is wrong here? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Just rearranging your command
echo $f | awk '{i=split($0,a,":");j=split($0,b,"|");print"$idlServantsHash{'\''"a[1]":"a[2]"'\''}"" = ""'\''"b[2]"'\''"}' Couldn't test it properly due to lack of input |
|||
| Google The UNIX and Linux Forums |