0

Running a program with & appended is a handy way to run it as a background process, but the program is still leashed to the terminal; if you quit Terminal.app, the program ends.

How can you start a program from Terminal.app that will still run if the terminal is closed?

1
  • See nohup and disown, which also exist in OS X.
    – slhck
    Mar 15, 2013 at 8:01

1 Answer 1

-1

Make a shell script to launch it. Programs run from the terminal are considered children of that terminal. Killing the terminal will in turn kill all the forked processes.

An example could be:

#!/bin/bash
program_name &

Save the file as something like:

filename.sh
chmod +x filename.sh

chmod +x will make it executable, the program should now be double clickable.

1
  • I'm not looking for a clickable file (the particular program, Emacs for Mac OS X, already has a clickable icon). I'm looking for a Mac way to emulate runemacs.exe, which runs separately from the calling terminal. Ampersand is helpful, but it does not do this. There are ways to do this, I just don't know how.
    – mcandre
    Mar 15, 2013 at 12:17

Not the answer you're looking for? Browse other questions tagged .