Best way to launch applications from a bash script?

I’m writing a simple menu using the dialog utility in a bash script.

The idea is that the menu script will run in a screen session which I can connect to over SSH (or whatever else).

I want to then use the menu to start/stop applications running on the machine. For example there might be a menu item called “Start/Stop gEdit”. When it’s selected, one of two things could happen:

  1. If gEdit is not currently running, it starts it
  2. If gEdit is currently running, it stops it

My question is, what is the best way to launch (and close) applications from my bash script? This is on Debian.

Source: bash

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.