2
#!/bin/ksh
##########################################################################
$JAVA_HOME/bin/java -jar SocketListener.jar 8182

run_something_else

exit 0

SocketListener is started, and shell is waiting while SocketListener don't die.

How can I run run_something_else and SocketListener at the same time

1
  • 2
    Run it in the background by suffixing the command line with an &. Commented Apr 2, 2012 at 8:44

3 Answers 3

5
$JAVA_HOME/bin/java -jar SocketListener.jar 8182 &

add an ampersand(&) at the end.this will give control of the terminal to the next line and makes your SocketListener run in the background.

Sign up to request clarification or add additional context in comments.

Comments

3

nohup can be used to run the process in the background as daemon.

nohup runsomethingelse &

Comments

1

You could background something else:

nohup run_something_else &

Nohup will guarantee that sumething_else will run even if your terminal closes. So it will make it ignore sighup

2 Comments

Without the surrounding backticks, I presume?
The surrounding backticks where for the code tag :) i guess i pressed the button twice :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.