Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 25th May 2011, 02:23
cj09 cj09 is offline
Junior Member
 
Join Date: May 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Issue when running a bash script

1) Environment:Red Hat Linux bash shell

Script to be run owned by user :myUser
Home environment of myUser: pathto/home

2) ESP agent with root access will run

JobXXX.sh
su - myUser -c "/pathto/home/bin/script.sh"
where script.sh has some echo statements and an exit statement in the end


Current behaviour when running the script:
root@ServerName1>./JobXXX.sh

(and then the control remains on the following path)
myUser@Servername1[pathto/home]
(have to print "exit" to get the output of echo statements and ctrl back to root@ServerName1


Expected behaviour when running the script:
root@ServerName1>./JobXXX.sh
  • Runs /pathto/home/bin/script.sh
  • Prints the echo statements
  • ctrl is root@ServerName1
Any suggestions how to fix the issue ?

Thanks for help.
Reply With Quote
Sponsored Links
  #2  
Old 13th July 2011, 15:22
gerr1t gerr1t is offline
Junior Member
 
Join Date: Jul 2010
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post
Default

Your post is very confusing.

Could you paste the contents of jobxxx.sh and script.sh?

Thanks.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script for finding and replacement in any web page code (.htm file) vl72 Programming/Scripts 0 19th February 2011 15:12
I can't finish install due a problem Sam9999 Installation/Configuration 7 17th September 2010 22:33
help with php running as cgi script in Apache opensuse 11.3 wildnux Server Operation 2 13th September 2010 13:01
Internet Explorer won't connect to my server wctaelectronics Server Operation 10 27th October 2008 21:14
https protocol stops page load tjd General 7 18th November 2007 18:06


All times are GMT +2. The time now is 01:36.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.