The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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
how to access values of awk/nawk variables outside the awk/nawk block? saniya Shell Programming and Scripting 5 05-13-2008 04:37 AM
nawk & awk sd12 UNIX for Advanced & Expert Users 5 05-05-2008 07:46 AM
nawk/ksh help DeltaX Shell Programming and Scripting 0 03-06-2008 11:54 AM
nawk -v to awk kamel.seg Shell Programming and Scripting 2 12-18-2007 03:30 AM
nawk whatisthis Shell Programming and Scripting 3 09-29-2004 10:44 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-06-2008
Registered User
 

Join Date: Feb 2005
Posts: 17
How to use awk instead of nawk?

Hi all,
I can run the following script using nawk..However, I find that teh server dun support nawk.. May I know how to change teh script to use awk such that it will work? Very urgent.. thx!

nawk 'BEGIN {FS=OFS=","}
NR==FNR{arr[$1]=$2;next}
$0 !~ "Documentation"{print $0;next}
{split($9,a,"-")}
a[3] in arr{$11=arr[a[3]]}1' $CONFIG_TXT $FILENAME > $OUTPUT
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-06-2008
Registered User
 

Join Date: Feb 2005
Posts: 17
use awk instead of nawk

Hi all,
In addition, if awk is used, bailing out msg is appeared.


awk: syntax error near line 2
awk: bailing out near line 2

Can someone pls kindly help?
Reply With Quote
  #3 (permalink)  
Old 05-07-2008
radoulov's Avatar
addict
 

Join Date: Jan 2007
Location: Milan, Italy/Varna, Bulgaria
Posts: 1,432
It would be easier if you post a sample of your input and the desired output.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:20 PM.


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

Content Relevant URLs by vBSEO 3.2.0