Sign in to follow this  
Followers 0
ngskicker

Send command arguments to running script

3 posts in this topic

Is it possible to send argument to already running script, I'll try to explain as I can, 

I create some CUI script to write something to console and idle if nothing to write, I want when I execute the same script with some argument script will not start the second instance instead the first instance  will take the argument and then write the argument to console

- script.exe (instance 1) running and idle

- then I run the script.exe again with argument

- instead script.exe (instance 2) running, I want script.exe (instance 1) write argument to the console,

is this posibble?

Thanks,

Share this post


Link to post
Share on other sites



this has been discussed many times, lately here:

'?do=embed' frameborder='0' data-embedContent>>

and here:

'?do=embed' frameborder='0' data-embedContent>>

in short: you can do some kind of IPC. for your example, i'd go for quick and dirty, like in the 1st link above.

script is launched:

option 1) with arguments. script writes a file with the arguments and exits.

option 2) without arguments: script runs and remains idle, waiting for a file with arguments. when such file exists, script processes the arguments.

 

if you prefer a more elegant way, check out the 2nd link above.

Share this post


Link to post
Share on other sites

Great

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0