LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-14-2009, 01:14 PM   #1
mike2008
LQ Newbie
 
Registered: Apr 2009
Posts: 7

Rep: Reputation: 0
carriage return


Hi there,

I'm writing a script that logs into the oracle db, execute a command "recover standby database;", then the command prompts the user to enter a value such as "auto" before the command can be executed.

Below is my script, but it is not performing the actions I wanted. Thanks in advance

#!/bin/bash
sqlplus / as sysdba <<CMD
recover standby database;
auto <<EOF
exit;
EOF
CMD
 
Old 10-14-2009, 01:32 PM   #2
ikem
LQ Newbie
 
Registered: Oct 2009
Distribution: SliTaz
Posts: 18

Rep: Reputation: 1
Hmm.. I guess you can't nest files in files.
 
Old 10-14-2009, 05:31 PM   #3
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by mike2008 View Post
Hi there,

I'm writing a script that logs into the oracle db, execute a command "recover standby database;", then the command prompts the user to enter a value such as "auto" before the command can be executed.

Below is my script, but it is not performing the actions I wanted. Thanks in advance

#!/bin/bash
sqlplus / as sysdba <<CMD
recover standby database;
auto <<EOF
exit;
EOF
CMD
What actions do you want the script to do? Can you type the desired actions at a keyboard? Why not write a script that performs the same actions you would perform if you were at a keyboard?

The script you are writing hasn't the remotest chance of giving you what you want, regardless of what you want, which you don't specify.
 
Old 10-15-2009, 01:03 AM   #4
shahkent
LQ Newbie
 
Registered: Aug 2009
Posts: 13

Rep: Reputation: 1
Try the following:

1. Create a file called cmd.sql and add the following lines:

recover automatic standby database until cancel;
exit;

2. Modify your Bash shell script to read as follows:

#!/bin/bash
sqlplus / as sysdba @cmd.sql

I hope that this does the trick for you. Good luck.

Shahriar.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Minicom carriage return + hyperterminal kewl Linux - Software 2 03-22-2010 12:27 PM
grep detecting carriage return, how ? Grafbak Programming 22 01-13-2010 02:19 PM
workaround for C++ printf carriage return idc12 Programming 2 09-11-2006 01:13 PM
unescaping a carriage return in perl acid_kewpie Programming 10 09-20-2002 03:20 PM
pppd...carriage return?!? icyfire Linux - Software 1 02-14-2002 08:07 AM


All times are GMT -5. The time now is 03:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration