The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages here.

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 07:37 AM
How to use awk instead of nawk? kinmak UNIX for Dummies Questions & Answers 2 05-07-2008 04:34 AM
nawk & awk sd12 UNIX for Advanced & Expert Users 5 05-05-2008 10:46 AM
nawk/ksh help DeltaX Shell Programming and Scripting 0 03-06-2008 03:54 PM
nawk -v to awk kamel.seg Shell Programming and Scripting 2 12-18-2007 07:30 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1 (permalink)  
Old 09-28-2004
whatisthis's Avatar
whatisthis whatisthis is offline
Registered User
  
 

Join Date: Aug 2004
Posts: 175
Question nawk

Hi,
I had this syntax and no matter what I do, I can't get it run.
err message:
run6[101]: syntax error at line 121 : `(' unexpected


I went to line 121 and it's comment out!

All the variables passed to nawk are valid.

There are two places I suspect have the problem:
1.
=======================================
#/bin/nawk -v interviewerorg="$interviewerorg" -v interviewdate="$interviewd
ate" -v respond="$i" -v text="$text" '{printf "%8s %4s %5s %s\n", interviewdate
interviewerorg respond text}' >> respondent.tex.tmp.$$

========================================


2.
========================================
for i in `/bin/nawk -F"|" '{ print $1 }' bct.comp.tmp.$$ | /bin/sort -u`
do
#things to do here
done
========================================

This drives me crazy. Will someone tell me what I should do here?


Thanks!
  #2 (permalink)  
Old 09-28-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
I doubt that the error is where you think it is. Ignore the line numbers. There are two ways to find something like this.

1 search for each ( since one of them follows something wrong.

2 copy the script to a temp file. Run the temp file and reproduce the error. Now pull some stuff out...for example, remove the nawk statements and replace them with "echo nawk went here. Remove a little at a time and try to run the script after each removal. You just need to reach the point where the shell can parse the script. It's ok that the script can't do anything useful after you remove stuff.
  #3 (permalink)  
Old 09-29-2004
whatsfordinner whatsfordinner is offline
Registered User
  
 

Join Date: Sep 2004
Posts: 2
My script stopped right here. I didn't get any message.

+++++++++++++++++++++++++++++++++++++++++++++
/usr/bin/nawk -v interviewerorg="$interviewerorg" '{ printf("%4s\n",interviewerorg) }' >> respondent.tex.tmp.$$

+++++++++++++++++++++++++++++++++++++++++++++
Can you tell any syntax error fomr this?
  #4 (permalink)  
Old 09-29-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
I don't see any input being redirected into it from a pipe or shell. So it will read from stdin. If that's a file, it should be alright. If not it will read from the tty.

But this has nothing to do with :
run6[101]: syntax error at line 121 : `(' unexpected
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:18 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0