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?

Hennes
  • 64,768
  • 7
  • 111
  • 168
mcandre
  • 3,026
  • 5
  • 39
  • 61

1 Answers1

-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.

floby
  • 1
  • 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 '13 at 12:17