How does a shell script know how it was invoked?

From: Captain Dondo (yan_at_NsOeSiPnAeMr.com)
Date: 05/29/05


Date: Sun, 29 May 2005 05:46:18 -0700

I need to write a script that calls dialog to present the user with a few
options.

The script can be invoked either from inside an application or a command
line, specifically from inside gthumb (or similar app) as 'Open this
picture with' or as a standalone command line app.

gthumb, if you don't use it, is a picture browser.

The behavior I want is this:

If invoked from inside an app, open a terminal for the app.

If invoked from the command line, use the terminal you were invoked from.

I've not found any scripts that do this, leading me to believe it may be
impossible. But the word 'impossible' should not be in the *nix
vocabulary....

-- 
use munged address above to email me
SpamTrap DoMeNow@seiner.com 


Relevant Pages

  • Re: How to setup database in VS Setup project?
    ... I would like the script to run. ... I made a console app that runs the ... The command windows pops up real quick, ... The difference is that you need to execute one batch at a time. ...
    (microsoft.public.dotnet.general)
  • Re: [bash] running script for specific time
    ... command (for example tcpdump, tail or something like that - ... You aren't ever going to learn to script if you keep asking ... when it equals beginning time + 90 minutes, stop app. ... Now you need some good examples of bash scripts. ...
    (comp.os.linux.misc)
  • Re: Cant capture PID with script in cron
    ... > When you finish the script, post it and let's chat about it and jobs. ... # In Mac OS X the command line accepts the command "open" ... # The applescript performs a function in the Mac OS scripting language ... showing only the app name and not the path. ...
    (comp.unix.questions)
  • Re: Goofiness on OSX
    ... I tried a few cases of symlinks pointing to scripts ... when I call my script ... It's intended for starting wish from the command line. ... which OSX Finder starts as it would any other .app. ...
    (comp.lang.tcl)
  • Re: How does a shell script know how it was invoked?
    ... > I need to write a script that calls dialog to present the user with a few ... > picture with' or as a standalone command line app. ... > gthumb, if you don't use it, is a picture browser. ... > If invoked from inside an app, open a terminal for the app. ...
    (comp.os.linux.misc)