LinuxQuestions.org
Help answer threads with 0 replies.
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 02-21-2013, 01:06 AM   #1
charithsrng
LQ Newbie
 
Registered: Jan 2013
Posts: 26

Rep: Reputation: Disabled
two funtions are not working together


in my shell script i have below code.

apps_down()
{
. /ebiz1/QAL/apps/apps_st/appl/QALNEW_ct-eagorasvr1.env
su - applclone -c "
echo -e \"\t\t\t INFO : Shutting the apps as whoami .\"
whoami
echo -e \"\t\t\t INFO : check the logfile /home/applclone/error_log.txt for more information.....\"
$ADMIN_SCRIPTS_HOME/adstpall.sh apps/apps > /home/applclone/error_log.txt"
}

stop_dbs()
{
su - oraclone -c "
echo -e \"\t\t\t INFO :dbs are shutting.....\"
echo -e \"\t\t\t INFO : check the logfile /home/oraclone/error_log.txt for more information.....\"
/Installation/QAL/db/tech_st/11.1.0/appsutil/scripts/QALNEW_ct-eagorasvr1/addbctl.sh stop immediate > /home/oraclone/error_log.txt"
}
main(){
apps_down
stop_dbs
}

am able to run above two stop_apps and stop_dbs separately.But when running main funtion it hangs on stop_dbs funtion with message

"SQL*Plus: Release 11.1.0.7.0 - Production on Thu Feb 21 10:47:59 2013

Copyright (c) 1982, 2008, Oracle. All rights reserved.

Connected."

Please advice
 
Old 02-21-2013, 01:28 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Can you once add set -xv in your script, just below shebang, and invoke the script again? Then share the snippet of error.

Also once make following change in stop_dbs function as:
Code:
stop_dbs()
{
su - oraclone -c "
echo -e \"\t\t\t INFO :dbs are shutting.....\"
echo -e \"\t\t\t INFO : check the logfile /home/oraclone/error_log.txt for more information.....\"
/Installation/QAL/db/tech_st/11.1.0/appsutil/scripts/QALNEW_ct-eagorasvr1/addbctl.sh stop immediate > /home/oraclone/error_log.txt 2>/dev/null
}

Note: I removed ( " ) after /home/oraclone/error_log.txt

Last edited by shivaa; 02-21-2013 at 01:32 AM.
 
Old 02-21-2013, 02:35 AM   #3
charithsrng
LQ Newbie
 
Registered: Jan 2013
Posts: 26

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shivaa View Post
Can you once add set -xv in your script, just below shebang, and invoke the script again? Then share the snippet of error.

Also once make following change in stop_dbs function as:
Code:
stop_dbs()
{
su - oraclone -c "
echo -e \"\t\t\t INFO :dbs are shutting.....\"
echo -e \"\t\t\t INFO : check the logfile /home/oraclone/error_log.txt for more information.....\"
/Installation/QAL/db/tech_st/11.1.0/appsutil/scripts/QALNEW_ct-eagorasvr1/addbctl.sh stop immediate > /home/oraclone/error_log.txt 2>/dev/null
}

Note: I removed ( " ) after /home/oraclone/error_log.txt
Thanks for your timely Rply.
I Have done below modification for my code as you mentioned and Its working fine now
may i know the reason for this issue?

/home/oraclone/error_log.txt 2>/dev/null"
 
Old 02-21-2013, 05:42 AM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by charithsrng
I Have done below modification for my code as you mentioned and Its working fine now
may i know the reason for this issue?
Glad to hear that.

It was just a problem with std. error redirection as well as echo statements. You were not quoting the echo statements properly.

However, if it has solved, please the thread as solved.
 
1 members found this post helpful.
  


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
acpi nearly working IBM thinkpad R40e 2684HVG no Fn key working, throttling OK Emmanuel_uk Linux - Laptop and Netbook 2 05-31-2006 02:41 AM
Modifying funtions/Mac layer.How? Titanas25 Programming 0 04-06-2006 10:03 AM
c++ simultaneous funtions? Ha1f Programming 6 11-22-2005 07:04 PM
Anyone who used acl.h funtions? kcv SUSE / openSUSE 0 10-13-2005 08:09 PM
emacs? - how to get help with c++ or c funtions in it? breadbin Linux - Software 1 06-28-2003 07:03 PM


All times are GMT -5. The time now is 06:50 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