in reply to Detect Environment

If your make your two programs, one being
#!/bin/sh program --gui $*
Then you can just click on it, it's never ambiguous, and you let the user control which one he wants if he wants to be specific.

Altenatively, you could accept --console and --gui to force one, and use heuristics if neither is specified.

Replies are listed 'Best First'.
Re^2: Detect Environment
by JadeNB (Chaplain) on Dec 10, 2009 at 01:14 UTC
    There's also the popular “hard-links that investigate $0 approach”. While we're chatting about shell scripting, I think "$@" (in Bash, not Perl!) gives a more robust approach to grabbing command-line arguments.