nawk: syntax error at source line 11


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers nawk: syntax error at source line 11
# 1  
Old 12-09-2009
nawk: syntax error at source line 11

Hi,
I executing a awk in a shell script. A part of AWK is:

Code:
nawk -F"¤" -v fichero=${DIRECTORIO_PARAMETROS}/${FICHERO_CONFIGURACION_CHEQUEOS} -v sistema=${SISTEMA_SEDRA} -v fichero_no_validos="No_validos_CAMPO_TIPO_${SIST}.dat"  'BEGIN{
 if  ( fichero != "")                               
 {                                                  
         while ( ( getline < fichero ) > 0 )        
         {                                          
                configuracion [$1] = $2                
         }                                          
 } 
 
  tipo=configuracion [sistema"_CAMPO_TIPO"]
 exit=0                                        
}

But obtain this error:

Code:
nawk: syntax error at source line 11
 context is
         >>>    exit= <<< 0
nawk: illegal statement at source line 11

Because this error can happened?
# 2  
Old 12-09-2009
you can use exit 0 in place of exit=0

Thanks
Penchal
# 3  
Old 12-09-2009
Thanks,

With that solves that error code. But later I find the following code:

Code:
if (( NF != configuracion [sistema"_"producto"_CAMPOS"] ) && ( exit=="0" ))
  {
   printf "El número de campos no es correcto para la línea %s\n",$0 >> fichero_no_validos
   exit=1
  }

Code:
nawk: syntax error at source line 30
 context is
         >>> it <<< =="0" ))
nawk: illegal statement at source line 30


As in this case could solve the problem?

Thanks.

---------- Post updated at 07:38 AM ---------- Previous update was at 03:56 AM ----------

Anybody know a solution?

Thanks! and sorry
# 4  
Old 12-09-2009
"exit" is a builtin. Use something else like exit_code for user defined variable.
# 5  
Old 12-10-2009
Quote:
Originally Posted by binlib
"exit" is a builtin. Use something else like exit_code for user defined variable.
Thanks, Already solved it.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

./1.sh: Syntax error at line 1 : `<<' is not matched.

function user { sqlplus primeit@$ORACLE_SID/primeit <<EOF select user_name from test; EOF } function gen { genpwdfile dec -in $1 -out $2 echo $1 echo $2 } function reset { sqlplus primeit@$ORACLE_SID/primeit... (7 Replies)
Discussion started by: ripudaman.singh
7 Replies

2. Shell Programming and Scripting

Nawk in a tail - syntax question

Hello. I run the following command to get data from a logfile: nawk 'BEGIN {FS="|"} {if ($6=="sonusSgxConfigurationErrorNotification") print ":" $10 ":" $11}' sonustrap.log | nawk 'BEGIN {FS=":"} {print $3 $5}' This command is 'static' from the .log file, however I wanted tail -f this and... (3 Replies)
Discussion started by: lennys26
3 Replies

3. Shell Programming and Scripting

Receiving error: ./ang.ksh[35]: 0403-057 Syntax error at line 116 : `done' is not expected.

Hi All I am quite new to Unix. Following is a shell script that i have written and getting the subject mentioned error. #!/bin/ksh #------------------------------------------------------------------------- # File: ang_stdnld.ksh # # Desc: UNIX shell script to extract Store information.... (3 Replies)
Discussion started by: amitsinha
3 Replies

4. Shell Programming and Scripting

nawk: illegal statement at source line 1

Hello Everyone, I don't know what is wrong with this: Is it that nawk cannot run a ".sh" script or is it not treating "." as a literal. If so how to make "." be treated as a literal in "nawk" statemnts? Thanks in Advance (2 Replies)
Discussion started by: bhaire
2 Replies

5. Shell Programming and Scripting

ERROR: ./launch_full_backup.sh[18]: Syntax error at line 28 : `else' is not expected.

Help please! :confused: I have the following error with the following file and the emails are not arriving to the email, any idea please? ERROR: ./launch_full_backup.sh: Syntax error at line 28 : `else' is not expected. FECHA=`date +%d%m%y%H%M`... (2 Replies)
Discussion started by: villenan
2 Replies

6. Shell Programming and Scripting

Syntax error at line 11 : `for' is not matched.

hi , while running this script i am getting below error: Syntax error at line 11 : `for' is not matched. here is program: #! /bin/ksh sqlplus -s << !+! user/password update GR_SUB_SCRIPT_PC set act_del_ind='0'; commit; exit; !+! cd /home/salunke/pvcsfiles/source_files for i in... (5 Replies)
Discussion started by: digambar
5 Replies

7. UNIX for Dummies Questions & Answers

syntax error at line 8: `(' unexpected

Hi I am having a shell script load_data.sh which calls /home/users/project/.profile. When am executing the script, am getting below error: $sh -x bin/load_data.sh null + . /home/users/project/.profile bin/load_data.sh: syntax error at line 8: `(' unexpected The line which is throwing... (1 Reply)
Discussion started by: brijesh.dixit
1 Replies

8. Shell Programming and Scripting

nawk syntax error

I have following problem! If i trie to execute this command: nawk '{system("/opt/EMCpower/bin/emcpadm renamepseudo -f d -s "$1" -t "$2")}' ${filestart}$1${fileend} where ${filestart}$1${fileend} is a filename and $1 and $2 is the first and second column of the file! I get the following error... (6 Replies)
Discussion started by: Helmut
6 Replies

9. Programming

sh: syntax error at line 1: `>' unexpected

I compiled C program under SUN OS sparcv9 ...I had a problem related to SIGBUS which has been resolved by adding an option to the CC compiler which is memory alignement option ..-memalign=1i as I remmber ...after running the program I got the below error please let me KNow more details what should... (2 Replies)
Discussion started by: atiato
2 Replies

10. Shell Programming and Scripting

syntax error on line 1, teletype

Hi There, I have a cron script that returns the error: syntax error on line 1, teletype Has any one seen this, know what it is, or know's how to get rid of it? Thanks, Jeremy. (1 Reply)
Discussion started by: KokoPops
1 Replies
Login or Register to Ask a Question