LinuxQuestions.org
Visit Jeremy's Blog.
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 06-25-2010, 12:22 AM   #1
JohnRock
LQ Newbie
 
Registered: May 2009
Posts: 28

Rep: Reputation: 15
How to make a bash script keep running in same terminal after it calls second script?


I have a startup script for jboss (start.sh) that sets some JAVA_OPTS and then calls bash run.sh.

If I run it (start.sh) from the command line it runs in the terminal fine. If I make a shortcut launcher for it in gnome and set it for 'application in terminal' it pops up then immediately dies after launch.

Not sure what the problem is. Is this not working because one script is calling a second script? But then why does it work when I call ./start.sh?

ANy help would be greatly appreciated - thanks!
 
Old 06-25-2010, 12:47 AM   #2
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,562

Rep: Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939
Where is the second script? Are you using the full path to it or just calling it by name?

When a terminal launches something it is not necessarily launching from the same directory.
 
1 members found this post helpful.
Old 06-25-2010, 01:59 AM   #3
subho.d
Member
 
Registered: Jun 2010
Location: INDIA
Distribution: All Linux & Unix
Posts: 86

Rep: Reputation: 19
use gnome-terminal command or use xterm option ...
 
Old 06-25-2010, 06:26 AM   #4
JohnRock
LQ Newbie
 
Registered: May 2009
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by grail View Post
Where is the second script? Are you using the full path to it or just calling it by name?

When a terminal launches something it is not necessarily launching from the same directory.
Thanks for the tip! That was exactly what the problem was. I added a line to change into that directory and now it works.
 
Old 06-25-2010, 09:16 AM   #5
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,562

Rep: Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939
As a tip I would use full path names instead of that approach. This generally helps later when you modify the script but can't remember
why you were changing directories
 
  


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
Running Bash script in PHP script SteveMack2015 Linux - Software 2 05-14-2010 03:34 PM
a script calls another script which calls "bash" inside lordofring Linux - Software 10 03-18-2010 09:59 AM
Is 'nice' inherited to child processes? e.g. bash script/php script that calls MySQL SirTristan Linux - Newbie 1 12-04-2008 12:57 AM
bash script to resize gnome terminal ? smoker Linux - General 1 03-17-2006 03:32 PM
Bash Script - How do I make sure my program is still running? nro Linux - Newbie 4 08-28-2005 01:57 PM


All times are GMT -5. The time now is 10:55 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration