1826604 Members
3632 Online
109695 Solutions
New Discussion

script help

 
jackfiled
Advisor

script help

Hi all
that's the problem here.
script executed one of commands, so
I want it to execute full command.
ex) sqlplus /nolog
system has executed sqlplus only exclude /nolog.
it must execute not only sqlplus but also /nolog concurrently

truly tips are good to me.


5 REPLIES 5
Fred Ruffet
Honored Contributor

Re: script help

Can you post your script ? It will surely help.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
jackfiled
Advisor

Re: script help

# Get DB info

get_db_info()
{
#$ORACLE_HOME/bin/svrmgrl << EOF > $DB_INFO
$ORACLE_HOME/bin/sqlplus /nolog << EOF > $DB_INFO
#connect internal
connect / as sysdba
T G Manikandan
Honored Contributor

Re: script help

sqlplus /nolog << EOF >a.log
connect sys / as sysdba
select name from v\$database;
EOF
exit
Fred Ruffet
Honored Contributor

Re: script help

Sounds good to me if sqlplus input ends with :
exit
EOF

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Muthukumar_5
Honored Contributor

Re: script help

You have to complete the started read-up command line as,
#$ORACLE_HOME/bin/svrmgrl << EOF > $DB_INFO
$ORACLE_HOME/bin/sqlplus /nolog << EOF > $DB_INFO
#connect internal
connect / as sysdba

EOF

Or you can use as,
#$ORACLE_HOME/bin/svrmgrl << EOF > $DB_INFO
$ORACLE_HOME/bin/sqlplus /nolog <<-EOF > $DB_INFO
#connect internal
connect / as sysdba
EOF

where -EOF to stripe the tabs.

And more there some restriction on using as,
\new-line is
ignored, and \ must be used to quote the
characters \, $, `, and the first character of
word.


see ksh man page for Input/Output part
Easy to suggest when don't know about the problem!