Running background applications from Terminal.app

Discussion in 'macOS' started by Am3822, Jul 14, 2008.

  1. Am3822 macrumors 6502

    Am3822

    Joined:
    Aug 16, 2006
    Location:
    Groningen, The Netherlands
    #1
    Hi folks,

    I'm currently running Terminal.app with several open windows (invoked using command+N) and I've noticed that if I launch a background application in one of them (i.e., running something like matlab &), the application would terminate if I close that particular window (even though Terminal.app would still be running).

    Is there a way to get around it? Before 10.5 improved the integration of X11.app and Terminal.app, I mainly used X11.app's xterm, and there I had no such problem.
     
  2. sreedy macrumors 6502a

    Joined:
    Feb 24, 2005
    Location:
    Somerset
    #2
    You could try "nohup"ing it, this works in Linux:

    nohup matlab &

    nohup

    EDIT: Just tried this with a simple command, and the warning message says it will stop the command, but I closed anyway...... and the command is still running when I check.... so looks good.
     
  3. Am3822 thread starter macrumors 6502

    Am3822

    Joined:
    Aug 16, 2006
    Location:
    Groningen, The Netherlands
    #3
    Thanks for the information. It does look risky, though, given that in the past I've had to kill matlab on more than one occasion. Will I be able to terminate the process with 'kill -15 / -9' ?
     
  4. sreedy macrumors 6502a

    Joined:
    Feb 24, 2005
    Location:
    Somerset
    #4
    Sorry for the delay! Yeah you can still kill the process using kill -9 PID

    nohup just ignores hang-up signals (which you give on exit). Kill commands will still work.
     
  5. gvrocha macrumors newbie

    Joined:
    Jul 23, 2008
    #5
    And how to setup matlab to be run from command line?

    Hi,

    I also want to run matlab with the no hangup thing.
    Problem is, calling matlab from the command line is not working...

    I guess I have to create a shortcut to some executable file.
    Does anyone know what it is?

    If so, does that support running matlab in command line mode (matlab -nojvm) ?

    Any help appreciated.

    Best,

    gv
     

Share This Page