| | |
This is the error i get when i run my script: Unmatched `
Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
Hi,
can anyone please help me on this.
I dont understand as to why am getting this error..
Please, please help on this!
fortesting purpose I have commented certain lines..
can anyone please help me on this.
I dont understand as to why am getting this error..
Please, please help on this!
fortesting purpose I have commented certain lines..
Shell Scripting Syntax (Toggle Plain Text)
"Pre_s2a_leadtime.sh" 55 lines, 1233 characters #!/bin/csh # Check if program is already running and echo a time stamp for the log file #log_start_chk $0 $$ #if ( $status == 0 ) then #exit #endif #source run_env set L2S_RUN_LOG_FILE="Pre_s2a_leadtime.log" echo -n "$0 started" >> ${L2S_RUN_LOG_FILE} date '+%m%d%y %H:%M:%S' >> ${L2S_RUN_LOG_FILE} #setenv DB_NAME viewer/viewer@ltstprod FLAG=`sqlplus -silent viewer/viewer@ltstprod << SQLEND >> ${L2S_RUN_LOG_FILE} set pagesize 0 feedback off verify off heading off echo off select UNCONSTRAINED_PIECE_PART from ICMPINPUTCONTROL; exit; SQLEND` if [ $FLAG ='Y'] then sqlplus viewer/viewer@ltstprod << sqlend >> ${L2S_RUN_LOG_FILE} # Running the following queries before the actual L2S program drop table cycle_time_bkp; create table cycle_time_bkp as select * from cycle_time; update cycle_time a set cycle_time_days = 0 where exists(select 1 from route b where a.id = b.id and a.route = b.route and b.flow_id = 7); quit "Pre_s2a_leadtime.sh" 55 lines, 1256 characters
0
#2 Oct 9th, 2009
Line 21 of your original post is missing a `:
Shell Scripting Syntax (Toggle Plain Text)
FLAG=`sqlplus -silent viewer/viewer@ltstprod << SQLEND >> ${L2S_RUN_LOG_FILE}
0
#3 Oct 9th, 2009
Hi sknake,
thanks a lot for hte quick response.
I already have ` symbol at he end of second SQLEND
at line 25 of my initial code tag
for your ref..
thanks a lot for hte quick response.
I already have ` symbol at he end of second SQLEND
at line 25 of my initial code tag
for your ref..
Shell Scripting Syntax (Toggle Plain Text)
FLAG=`sqlplus -silent viewer/viewer@ltstprod << SQLEND >> ${L2S_RUN_LOG_FILE}set pagesize 0 feedback off verify off heading off echo offselect UNCONSTRAINED_PIECE_PART from ICMPINPUTCONTROL;exit;SQLEND`
0
#4 Oct 9th, 2009
I missed that. You need to instruct CSH that the command is split over multiple lines:
Shell Scripting Syntax (Toggle Plain Text)
FLAG=`sqlplus -silent viewer/viewer@ltstprod << SQLEND >> ${L2S_RUN_LOG_FILE} \ set pagesize 0 feedback off verify off heading off echo off \ select UNCONSTRAINED_PIECE_PART from ICMPINPUTCONTROL; \ exit; \ SQLEND`
0
#5 Oct 9th, 2009
Thank you very much Scott, it worked! (but without spaces before \ symbol).
Thanks once again.
now Am stuck with another error in my code. Though the values in table column in Y, I get this error. The if condition is supposed to be true.
Error is:
[Y=Y]: No match
Thanks once again.
now Am stuck with another error in my code. Though the values in table column in Y, I get this error. The if condition is supposed to be true.
Error is:
[Y=Y]: No match
Shell Scripting Syntax (Toggle Plain Text)
"Pre_s2a_leadtime.sh" 54 lines, 1243 characters #!/bin/csh # Check if program is already running and echo a time stamp for the log file #log_start_chk $0 $$ #if ( $status == 0 ) then #exit #endif #source run_env set L2S_RUN_LOG_FILE="Pre_s2a_leadtime.log" echo -n "$0 started" >> ${L2S_RUN_LOG_FILE} date '+%m%d%y %H:%M:%S' >> ${L2S_RUN_LOG_FILE} #setenv DB_NAME viewer/viewer@ltstprod set FLAG=`sqlplus -silent viewer/viewer@ltstprod << SQLEND\ set pagesize 0 feedback off verify off heading off echo off\ select unconstrained_piece_part from icmpinputcontrol;\ exit;\ SQLEND` if [$FLAG='Y'] then sqlplus viewer/viewer@ltstprod << sqlend >> ${L2S_RUN_LOG_FILE} # Running the following queries before the actual L2S program drop table cycle_time_bkp; create table cycle_time_bkp as select * from cycle_time; update cycle_time a set cycle_time_days = 0 where exists(select 1 from route b where a.id = b.id and a.route = b.route and b.flow_id = 7); commit; quit sqlend "Pre_s2a_leadtime.sh" 54 lines, 1243 characters
1
#6 Oct 9th, 2009
Change the format of your if statement:
Shell Scripting Syntax (Toggle Plain Text)
sk:/tmp> set FLAG="Y" sk:/tmp> echo $FLAG Y sk:/tmp> if ( ${FLAG} == Y ) echo "hi" hi sk:/tmp> if ( ${FLAG} == N ) echo "hi" sk:/tmp>
Last edited by sknake; Oct 9th, 2009 at 4:56 am.
0
#7 Oct 9th, 2009
Thanks a lot Scott!
it worked..
one more thing, am I connecting to sql more than once. but i use sqlend eachtime. am getting a message saying script FAILED at the end, though all sql stmts are executing completely.
Can you advise why is this?
My log file output is as below
it worked..
one more thing, am I connecting to sql more than once. but i use sqlend eachtime. am getting a message saying script FAILED at the end, though all sql stmts are executing completely.
Can you advise why is this?
My log file output is as below
Shell Scripting Syntax (Toggle Plain Text)
Pre_s2a_leadtime.sh started100909 02:51:37 SQL*Plus: Release 9.2.0.3.0 - Production on Fri Oct 9 02:51:37 2009 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connected to: Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.3.0 - Production SQL> SP2-0734: unknown command beginning "Running th..." - rest of line ignored. SQL> SQL> Table dropped. SQL> SQL> Table created. SQL> SQL> 2 649 rows updated. SQL> Commit complete. SQL> Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Produc tion With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.3.0 - Production Pre_s2a_leadtime.sh has FAILED
0
#8 Oct 9th, 2009
I don't know. What is throwing the error -- the oracle client or the script? I'm not that familiar with csh or oracle. Sorry I couldn't be of any help on this one. You do have a comment in the middle of your SQL Statement though -- Maybe that is causing it to report the failure:
At that point it isn't interpreting that line as shellscript but rather piping the contents to a file which is evident in:
Move that comment above the >>file and see if that cures your issue
"Pre_s2a_leadtime.sh" 54 lines, 1243 characters
#!/bin/csh
# Check if program is already running and echo a time stamp for the log file
#log_start_chk $0 $$
#if ( $status == 0 ) then
#exit
#endif
#source run_env
set L2S_RUN_LOG_FILE="Pre_s2a_leadtime.log"
echo -n "$0 started" >> ${L2S_RUN_LOG_FILE}
date '+%m%d%y %H:%M:%S' >> ${L2S_RUN_LOG_FILE}
#setenv DB_NAME viewer/viewer@ltstprod
set FLAG=`sqlplus -silent viewer/viewer@ltstprod << SQLEND\
set pagesize 0 feedback off verify off heading off echo off\
select unconstrained_piece_part from icmpinputcontrol;\
exit;\
SQLEND`
if [$FLAG='Y'] then
sqlplus viewer/viewer@ltstprod << sqlend >> ${L2S_RUN_LOG_FILE}
# Running the following queries before the actual L2S program
drop table cycle_time_bkp;
create table cycle_time_bkp as select * from cycle_time;
update cycle_time a set cycle_time_days = 0
where exists(select 1 from route b where a.id = b.id and a.route = b.route and b.flow_id = 7);
commit;
quit
sqlend
"Pre_s2a_leadtime.sh" 54 lines, 1243 charactersAt that point it isn't interpreting that line as shellscript but rather piping the contents to a file which is evident in:
SQL> SP2-0734: unknown command beginning "Running th..." - rest of line ignored.
SQL> SQL>
Table dropped.Move that comment above the >>file and see if that cures your issue
Last edited by sknake; Oct 9th, 2009 at 8:25 am.
![]() |
Similar Threads
- unable to run script with master page (ASP.NET)
- Debug Error Run-Time Check Failure #2 (C++)
- Help me please... (PHP)
- Run Script Dinamically (JavaScript / DHTML / AJAX)
- A little help please (PHP)
- Amaena and all that good stuff! (Viruses, Spyware and other Nasties)
- How to run A script (Graphics and Multimedia)
- Bus Error when I run my C++ program (C++)
- "error has occured in script on this page" (Windows NT / 2000 / XP)
Other Threads in the Shell Scripting Forum
- Previous Thread: Can somebody help with looping my command?
- Next Thread: Getting script to run on boot up in linux
Views: 753 | Replies: 8
| Thread Tools | Search this Thread |
Tag cloud for Shell Scripting






