Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

Issues with awk and tcsh

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-04-2012
maverick_here maverick_here is offline
Registered User
 
Join Date: May 2009
Last Activity: 30 October 2014, 10:43 PM EDT
Location: Hyderabad
Posts: 132
Thanks: 0
Thanked 6 Times in 5 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 Unix and Linux 12-04-2012
Scott's Unix or Linux Image
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 6 May 2015, 1:20 PM EDT
Location: Zürich
Posts: 8,537
Thanks: 336
Thanked 1,065 Times in 928 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 Unix and Linux 12-04-2012
maverick_here maverick_here is offline
Registered User
 
Join Date: May 2009
Last Activity: 30 October 2014, 10:43 PM EDT
Location: Hyderabad
Posts: 132
Thanks: 0
Thanked 6 Times in 5 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 Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 08:33 PM.