Find the answer to your Linux question:
Results 1 to 3 of 3
Sorry if the title sounds vague or I word the following badly. I'm fairly new to Linux, I've used it but not for anything other than very basic stuff. Here ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2011
    Posts
    4

    Run a script and exit terminal upon completion


    Sorry if the title sounds vague or I word the following badly. I'm fairly new to Linux, I've used it but not for anything other than very basic stuff.

    Here is the situation.

    I want to call a script that starts Tomcat 5. The script will call a .sh file called catalina.sh. If any of you have used Tomcat and started it this way you will know that it will start up pretty fast and a message will hang in the terminal saying it's started up. When you run shutdown.sh you will see a shutdown message and you will be then be able to resume typing commands etc into the terminal. What I want to do is to be able to call a script (in my case start_tomcat.sh) that starts tomcat (calls catalina.sh) and then when Tomcat is shutdown the terminals close instead of remaining there.

    I did the same in Windows and it was a case of putting

    start /min cmd /c myfile.bat

    Hope that helps, if I wasn't clear enough then say and I will try clear it up. Hope you guys can help.

  2. #2
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    Hello and Welcome!

    As far as using Tomcat... nope. Never have.
    But as far as closing the terminal window afterwards, try appending & exit to the last line if your script.
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

  3. #3
    Just Joined!
    Join Date
    Sep 2011
    Posts
    4
    Hey, thanks for the welcome.

    It worked, catalina.sh run & exit. Worked a treat. Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •