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


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Syntax error at line 11 : `for' is not matched.
Prev   Next
# 1  
Old 06-29-2009
Syntax error at line 11 : `for' is not matched.

hi ,
while running this script i am getting below error:
Code:
Syntax error at line 11 : `for' is not matched.

here is program:
Code:
#! /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 *.sh
do
       ln_no=`grep -in description.*: $i | cut -f1 -d:`
       m_main_desc=""
       if [ $ln_no -ne "" ]
       then
       ln_no=`expr $ln_no + 1`
	echo "Line:$ln_no"
       head -$ln_no $i | tail -2 |sed -e 's/#//g' -e 's/*//g' -e 's/[Dd]escription.*://g'| tr -d "\n">desc.txt
       for line in $(cat desc.txt);
       do
       m_desc=`echo $line | sed -e 's/^$//'`
       m_main_desc="$m_main_desc $m_desc"
       done
       fi
       ln_no=`grep -in purpose.*: $i | cut -f1 -d:`
      if [ $ln_no -ne "" ]
       then
       ln_no=`expr $ln_no + 1`
	echo "Line:$ln_no"
	head -$ln_no $i | tail -2 |sed -e 's/#//g' -e 's/*//g' -e 's/[Pp]urpose.*://g'| tr -d "\n">desc.txt
	 for line in $(cat desc.txt);
	do
       m_desc=`echo $line | sed -e 's/^$//'`
      m_main_desc="$m_main_desc $m_desc"
     done
    fi
	  ln_no=`grep -in "Pgm Desc.*:" $i| cut -f1 -d:` 
	 if [ $ln_no -ne "" ]
	then
       ln_no=`expr $ln_no + 1`
       echo "Line:$ln_no"
       head -$ln_no $i | tail -2 |sed -e 's/#//g' -e 's/*//g' -e 's/[Pp]gm [Dd]esc.*://g'| tr -d "\n">desc.txt
	for line in $(cat desc.txt);
	do
       m_desc=`echo $line | sed -e 's/^$//'`
     m_main_desc="$m_main_desc $m_desc"
	  done
      fi


       rm log1.txt	
       grep -i "m_prog_name=" $i |sed -e 's/#.*//p' -e 's/echo.*//p' -e '/^$/ d'>log1.txt
       grep -i "pgm_name=" $i |sed -e 's/#.*//p' -e 's/echo.*//p' -e '/^$/ d'>>log1.txt
       grep -i "m_prog_nm=" $i |sed -e 's/#.*//p' -e 's/echo.*//p' -e '/^$/ d'>>log1.txt
       #awk '{split ($0,a,"="); print a[2]}' log1.txt |sed 's/[.a-zA-Z]* //g' |sed -e 's/"//g'|sed -e s/\'//g>proc.txt
       var_proc=`awk '{split ($0,a,"="); print a[2]}' log1.txt |sed 's/[.a-zA-Z]* //g' |sed -e 's/"//g'|sed -e s/\'//g` 
       #for line in $(cat proc.txt);
       #do
	       echo "Shell Name: $i and PC name: $var_proc Description:$m_main_desc"
	       ret_val=sqlplus -s << !+!
	       ganachar/abcd4161
	       set serveroutput off;
	       set echo off;
	       whenever sqlerror exit 1 rollback;
	       whenever oserror exit 1 rollback;
	       set serveroutput on
	       exec pg_gr_inventory.sp_insert_sub_script_pc('$i','$var_proc','$m_main_desc');
	       exit ;
	       !+!
       #done
done

sqlplus -s << !+!
user/passwd
delete from GR_SUB_SCRIPT_PC where act_del_ind='0';
commit;
exit;
!+!

Please help me asap.!!! this is production issue.

Last edited by digambar; 06-29-2009 at 06:23 AM.. Reason: added code tags
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

0403-057 Syntax error at line 399 : `"' is not matched

Hi Everyone, I am getting strange behavior, same script runs fine without any error in one AIX machine, whereas on another it is throwing this error "0403-057 Syntax error at line 399 : `"' is not matched", I also ran the script in debug mode. This is the output, still doesn't say anything.... (2 Replies)
Discussion started by: sid1987
2 Replies

2. 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

3. Shell Programming and Scripting

0403-057 Syntax error at line 169 : `"' is not matched.

Hi, I am getting this error in my attached shell script, kindly help as soon as possible: Thanks, Andre (2 Replies)
Discussion started by: damoon
2 Replies

4. Shell Programming and Scripting

[Solved] 0403-057 Syntax error `<' is not matched

curr_time=`date +%Y%m%d%H%M` curr_date=`date +%Y%m%d` zero=0 script_path="/home/wccuser1/wcc/Scripts/bulk_file_ftp" file_dir="/home/wccuser1/wcc/Bulk_Files" todays_file_count=`ls -ltr | grep $curr_date | awk '{print $9}' | wc -l` todays_file=`ls -ltr | grep $curr_date | awk '{print $9}'` if... (5 Replies)
Discussion started by: gagandeep
5 Replies

5. 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

6. Shell Programming and Scripting

Makefile: syntax error at line 1

I am able to 'Make' some of projects's modules using GNU's make except one where it throws me the following error gmake -f Makefile /bin/sh: syntax error at line 1: `if' unexpected gmake: *** Error 2 I am sure it has nothing to do with the Makefile as there is no 'if' in the first... (1 Reply)
Discussion started by: sudsa
1 Replies

7. UNIX for Advanced & Expert Users

sh: syntax error at line 8 : `<<' is not matched.

Hi, I am trying to execute the above attached script. and i am getting the error as syntax error at line 8: `<<' is not matched. While i am trying to run that particular line (cat <<EOF > /tmp/query.sql) independently in the prompt it is running successfully without any error. I am running... (2 Replies)
Discussion started by: satyaatcgi
2 Replies

8. 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

9. Shell Programming and Scripting

get_source[34]: 0403-057 Syntax error at line 66 : `"' is not matched.

Hi, I am getting this error in my shell script, kindly help as soon as possible: ################################################################### # Main body of program ################################################################### . /saptech/scripts/common/declare # Defines... (1 Reply)
Discussion started by: vishal_ranjan
1 Replies

10. 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
Login or Register to Ask a Question