Using SHELL to get a list of processes
m.schonewille at economy-x-talk.com
Thu Feb 5 13:28:41 CST 2009
If you want to run only one instance of your standalone at a time, you
need to include a relaunch handler in your stack script. Assuming that
you want the existing instance to come to the foreground when the
second instance is launched and that you want the second instance to
quit immediately, all you need is to catch the message and not pass it:
return empty -- just for clarity, if you like
If you return "background", the second instance is terminated, but the
first instance won't be activated. If you pass the message, the second
instance will run.
Economy-x-Talk Consulting and Software Engineering
Dutch forum: http://runrev.info/rrforum
We are always looking for new projects! Feel free to contact us to
discuss your custom software project!
On 5 feb 2009, at 19:55, Hugh Senior wrote:
> Using shell()to determine if my Rev app is among the line of all
> processes. If so, then user has started a second instance and I want
> Task 1: Get a list of all running processes and IDs.
> Task 2: Get the process name and ID of my Rev app.
> With me so far? Okay...
> I should be able to get a list of all running process using "ps -e"
> (according to http://www.ss64.com/bash/ps.html).
> So I try this in the message box, hoping to see some sort of a list:
> answer shell("ps -e")
> What I get instead is 'ps is not recognised as an internal or external
> command, operable program or batch file.'
> Same result using shell("top") and shell("list-processes").
> So what stupidity am I doing, please (apart from naively expecting the
> syntax to work)? And how do I get the process name & ID of the app?
More information about the use-livecode