Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting a program to return immediately at the command line so it's not tied to the shell that launched it

Some programs return immediately when launched from the command line, Firefox for example. Most utilities (and all the programs I've written) are tied to the shell that created them. If you control-c the command line, the program's dead.

What do you have to add to a program or a shell script to get the return-immediately behavior? I guess I'm asking two questions there, one for shell scripts and one for general, if they're different. I would be particularly interested to know if there's a way to get an executable jar to do it.

I'm almost embarrassed to ask that one but I can't find the answer myself.

Thanks!

like image 302
Yuvi Masory Avatar asked Jan 26 '10 04:01

Yuvi Masory


1 Answers

start cmd 

on Windows,

cmd &

on *nux

Here substitute

cmd = java -jar JarFile.jar

On *nux the fg and bg commands are your friends as well ...

like image 56
Hamish Grubijan Avatar answered Oct 22 '22 08:10

Hamish Grubijan