![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| found error 138 while run shell script | rinku | Shell Programming and Scripting | 1 | 06-01-2008 11:29 PM |
| Shell Script Error | jazz8146 | UNIX for Dummies Questions & Answers | 0 | 04-23-2008 04:38 AM |
| awk Shell Script error : "Syntax Error : `Split' unexpected | Herry | UNIX for Dummies Questions & Answers | 2 | 03-17-2008 08:16 AM |
| FTP shell script error caturing | im_new | Shell Programming and Scripting | 6 | 01-15-2008 12:21 AM |
| shell script error logging | niamh | UNIX for Dummies Questions & Answers | 1 | 04-05-2004 08:17 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
error in shell script
Hi,
I have written a small shell script which logs into each oracle database on the server and displays whether it is in archivelog mode or not.. The script is as under: #!/bin/bash dblist=`ps -ef | grep smon | grep -v grep |cut -d'_' -f3` for ohome in $dblist; do sqlplus -s /nolog << EOF connect / as sysdba ; ORACLE_SID=$ohome; export ORACLE_SID set heading off set feedback off set verify off output=`select log_mode from v$database;` exit; EOF echo $ohome echo $output | sort -u done When I run it .. i received errors as under: jalpan.sh: select: not found Connected. SP2-0734: unknown command beginning "ORACLE_SID..." - rest of line ignored. SP2-0042: unknown command "output=" - rest of line ignored. bnkdbp01 jalpan.sh: select: not found Connected. SP2-0734: unknown command beginning "ORACLE_SID..." - rest of line ignored. SP2-0042: unknown command "output=" - rest of line ignored. dosdbp01 --> Oracle Database Name Pls help Thx in advance |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
1. is the ORACLE_SID line supposed to be before the sqlplus line?
2. Are the 'set x y' lines as part of the SQL*PLUS script supposed to have a ';' at the end? 3. The 'output', it looks like you are trying to assign in the SQL*PLUS script but have it magically read by the shell script. |
|
#3
|
|||
|
|||
|
Hi,
Reg your point 1 and 2 , you are correct. I did modify it and its working Reg point 3. i removed ref to output variable and just kept select stmt and it worked Thanks again for your guidance |
|||
| Google The UNIX and Linux Forums |