The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-17-2006
Registered User
 

Join Date: Aug 2005
Posts: 229
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?
Reply With Quote
Forum Sponsor
  #2  
Old 07-17-2006
Registered User
 

Join Date: Jun 2006
Location: Delhi, India
Posts: 88
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
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0