Issues with awk and tcsh | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


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

Issues with awk and tcsh

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-04-2012
maverick_here maverick_here is offline
Registered User
 
Join Date: May 2009
Last Activity: 10 March 2014, 1:15 PM EDT
Location: Hyderabad
Posts: 121
Thanks: 0
Thanked 5 Times in 4 Posts
Issues with awk and tcsh

Hello experts,

I have two files which I'm uploading. One is an awk script and other file acts as an input to the script via positional parameter.

awk -f intlmenu.awk jobsq.txt

This run fine in C shell on SCO OpenServer Release 5.0.7.

When I run it on Solaris 10 ( tcsh shell )

I get the following error


Code:
awk -f intlmenu.awk jobsq.txt

awk: string too long near line 103
awk: syntax error near line 103
awk: illegal statement near line 103
awk: newline in string near line 103

The 103 line in intlmenu script is as follows


Code:
 printf "echo \"Data File Start `head -1 %s.qca | awk -f /ychw/accts/firstlast.awk`  Datafile End `tail -1 %s.qca | awk -f /ychw/accts/firstlast.
awk` \" >>/tmp/$UETIME.txt  \n",project[i],project[i] >> OutFile

I suspect it is due to the c/tcsh shell's behavior since it complains about "Unmatched .".I have tried various combinations but have failed. Any help would be greatly appreciated.

The desired output is as follows


Code:
        [INTERVIEW LENGTH]
        SELECT ONE SURVEY
        ================

 1) /cati/meat/live/meatlive     2) /cati/bexp/live/bexplive
 3) /cati/fran/live/franlive     4) /cati/govt/live/govtlive
 5) /cati/deak/live/deaklive     6) /cati/mwir/live/mwirlive
 7) /cati/kely/live/kelylive     8) /cati/vcfn/live/vcfnlive
 9) /cati/melt/live/meltlive    10) /cati/msmi/live/msmilive
11) /cati/star/12w3/star12w3    12) /cati/star/boo3/starboo3
13) /cati/oztam/r12w4/main/rztm12w4     14) /cati/oztam/r12w4/ref/rztmref
15) /cati/oztam/r12w4/6ccb/rztm6ccb     16) /cati/oztam/r12w4/nesl/rztmnesl
17) /cati/oztam/r12w4/6unres/rztm6unr   18) /cati/oztam/12w4/main/oztm12w4

        NOW ENTER YOUR CHOICE

Thanks In advance
Attached Files
File Type: txt intlmenu.txt.txt (4.7 KB, 10 views)
File Type: txt jobsq.txt (1.9 KB, 10 views)

Last edited by maverick_here; 12-04-2012 at 05:58 AM.. Reason: Including the desired output
Sponsored Links
    #2  
Old 12-04-2012
Scott's Avatar
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 18 April 2014, 1:08 PM EDT
Location: in der Schweiz
Posts: 8,322
Thanks: 313
Thanked 1,013 Times in 886 Posts
Hi.

The underlying shell has likely nothing to do with it.

On Solaris I would use /usr/xpg4/bin/awk or nawk.

Try that first, before changing what might not be broken.
Sponsored Links
    #3  
Old 12-04-2012
maverick_here maverick_here is offline
Registered User
 
Join Date: May 2009
Last Activity: 10 March 2014, 1:15 PM EDT
Location: Hyderabad
Posts: 121
Thanks: 0
Thanked 5 Times in 4 Posts
Thanks Scott

I have used nawk and it worked fine. It is a migration project from Sco to Sun. It never occurred be about using nawk or /usr/xpg4/bin/awk. Once again thanks a million.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Awk OFS issues 02JayJay02 Shell Programming and Scripting 9 10-23-2012 04:22 AM
tcsh issues sardare UNIX for Dummies Questions & Answers 1 05-11-2010 11:07 AM
for / foreach syntax issues (in bash or tcsh) thepolypore Shell Programming and Scripting 0 02-08-2010 01:28 AM
Issues with AWK alanp AIX 12 05-07-2009 10:29 AM
Awk output issues. amatuer_lee_3 Shell Programming and Scripting 4 05-16-2008 08:23 PM



All times are GMT -4. The time now is 02:53 AM.