473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Script error

Hi,

Can anyone help me on the error message ? ; -)
recover.sh: line 18: syntax error: unexpected end of file
==================================
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/sh
  2. HostName=`hostname`
  3. LOGDIR=$PWDLE_SID
  4. LOGFILE=$LOGDIR/${MYSID}
  5. num=0
  6. while [$num -lt 10]
  7. do
  8. echo -n $num
  9. num='expr $num+1'
  10. sqlplus /nolog <<EOF
  11. conn / as sysdba
  12. recover datafile $num;
  13. exit
  14. done
  15.  
Thanks & Regards,
Vinod Sadanandan
Oracle DBA
Oct 19 '07 #1
3 1948
numberwhun
3,509 Expert Mod 2GB
Hi,

Can anyone help me on the error message ? ; -)
recover.sh: line 18: syntax error: unexpected end of file
==================================
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/sh
  2. HostName=`hostname`
  3. LOGDIR=$PWDLE_SID
  4. LOGFILE=$LOGDIR/${MYSID}
  5. num=0
  6. while [$num -lt 10]
  7. do
  8. echo -n $num
  9. num='expr $num+1'
  10. sqlplus /nolog <<EOF
  11. conn / as sysdba
  12. recover datafile $num;
  13. exit
  14. done
  15.  
Thanks & Regards,
Vinod Sadanandan
Oracle DBA
Well, you have a here document , line 10 above, that tells the script to do all of the commands that follow until you see "EOF" on a line by itself. if that is the case, then you have not met the requirements of the here document. You need to have EOF on a line by itself, I assume, right before the word "exit".

Regards,

Jeff
Oct 19 '07 #2
Hi Jeff ,

Thanks for the turn around,changed it like this,

Expand|Select|Wrap|Line Numbers
  1. funct_get_datafiles(){
  2. #Get the list of datafiles
  3. echo "Getting datafiles list " >> ${DATAFILES}
  4. file_list='{ORACLE_BASE}/sqlplus -s <<EOF
  5. /as sysdba
  6. set heading off  feedback off
  7. select distinct file_id from dba_data_files order by file_id;
  8. exit
  9. EOF'
  10. echo "####### DATE :" 'date'  > ${RECOVER}
  11. for datafile in 'echo $file_list'
  12. do
  13. ${ORACLE_BASE}/sqlplus -s <<EOF
  14. /as sysdba
  15. set heading off feedback off
  16. recover datafile ${file_list};
  17. exit
  18. EOF
  19. }
  20.  
Thanks & Redagrds,
Vinod Sadanandan
Oracle DBA
Oct 23 '07 #3
numberwhun
3,509 Expert Mod 2GB
Hi Jeff ,

Thanks for the turn around,changed it like this,

Expand|Select|Wrap|Line Numbers
  1. funct_get_datafiles(){
  2. #Get the list of datafiles
  3. echo "Getting datafiles list " >> ${DATAFILES}
  4. file_list='{ORACLE_BASE}/sqlplus -s <<EOF
  5. /as sysdba
  6. set heading off  feedback off
  7. select distinct file_id from dba_data_files order by file_id;
  8. exit
  9. EOF'
  10. echo "####### DATE :" 'date'  > ${RECOVER}
  11. for datafile in 'echo $file_list'
  12. do
  13. ${ORACLE_BASE}/sqlplus -s <<EOF
  14. /as sysdba
  15. set heading off feedback off
  16. recover datafile ${file_list};
  17. exit
  18. EOF
  19. }
  20.  
Thanks & Redagrds,
Vinod Sadanandan
Oracle DBA
Vinod,

I am glad that the solution worked for you. In the future, when you post code to the forums, please remember to place [code] [/code] tags around the code so the moderators don't have to follow up behind you and add them.

Thank you!

Regards,

Jeff
Oct 23 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Will Seay | last post by:
At the end of this message I've pasted a script we're trying to modify slightly. I don't believe it is VBscript or javascript but these are the closest groups I could find with my limited...
6
by: Clay Beatty | last post by:
When you create database diagrams in Enterprise Manager, the details for constructing those diagrams is saved into the dtproperties table. This table includes an image field which contains most of...
12
by: tshad | last post by:
I am not sure why I am getting this error: I have the following code I want to run from another include file that holds all my functions. functions.inc...
17
by: comp.lang.tcl | last post by:
The TCL command I am using will do a command-line action on a PHP script: set cannotRunPHP I have to do it this way as both the TCL script and the PHP script run as CLI. However, "info.php"...
19
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
5
by: Bjorn Sagbakken | last post by:
Hello I have just migrated from VS 2003 to VS 2005, and .NET framework 1.1 to 2.0 I am at the end of debugging and fixing stuff. Now there is one error I just cannot find a solution to: On...
15
by: Lawrence Krubner | last post by:
Does anything about this script look expensive, in terms of resources or execution time? This script dies after processing about 20 or 25 numbers, yet it leaves no errors in the error logs. This is...
3
by: GazK | last post by:
I have been using an xml parsing script to parse a number of rss feeds and return relevant results to a database. The script has worked well for a couple of years, despite having very crude...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
7
by: jeddiki | last post by:
Hi, As I am in Turkey at present, I can not see vidoes on youtube. So I have tried a few proxies but keep finding them slow or not working. So I have installed myphpProxy on my server under...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.