I am writing a tcsh script that will open an already-running processs on a system, and give it a command. I want to have something similar to this:
But I need to be able to find the process and insert the command, either kill or something else, all in one line.
I'm thinking it would look something like this:
Please reply soon, as I need to get this to work quickly, though I am not at all sure what to do.
Last edited by Adorai; 08-03-2011 at 09:02 AM..
Reason: Correct bad format
When you say give it a command, I believe you mean send it a signal, you can send signals via kill with the appropriate number as a flag eg.
Or using the example you provide
That said, despite your haste, you should have a read of TLDP IPC guide
Last edited by Skrynesaver; 08-03-2011 at 09:33 AM..
Reason: additional reading recommendation.
Having seen the guide, I don't think sending a signal is what I need.
Here is the basic situation:
User A launches a process.
User B is logged in to the same system and needs to access the process to give it a command (what the script is for). Acceptable commands are start, stop, pause, and kill, kill ending the process entirely, while the other commands give it specific instructions.
Although from the format of your answer, it sounds like this should work:
Or can that only be done with kill?
User A starts seeing this:
prompt>
User A starts the process:
prompt> <process>
User A gives any of the aforementioned commands to the process:
prompt/process> <command>
It sounds as though your process is going to have to have a signal handler so that the user B can send various signals (note that a signal handler can do whatever it likes when it receives any signal except SIGKILL(9) or you could implement a "management" shell that user B can log into and issue commands to the process on.
Hi,
$ cat f1
My name is Bruce and my surname is
I want to use SED to find “Bruce” and then append “ Lee” to the end of the line in which “Bruce” is found
Then a more tricky one…. I want to INSERT ….a string… in to a line in which I find sometihng. So example
$ cat f2
My name is... (9 Replies)
I have many command is list in the variable lists,each command will run a very long time, so I want to run 5 commands at the same time with process till it complete run all the command,
lists="aa bb cc dd xx gg blabla zz ......." ( a very long list)
can some one point me the codes?
... (7 Replies)
Hi:
I have a program written in FORTRAN running on AIX platform.
It is because missing of documentation and without root password, therefore we want to modify the program so that we can find out which script/program that call this FORTRAN program.
I have google for few days, all of them are... (3 Replies)
Hi
I have this script:
#!/bin/ksh
cmd1 | cmd 2 |cmd 3| cmd4
which it creates 4 process....
Is possible to create a single process PID1 which include all commands?
Thanks
Israel (2 Replies)
Hi All
I'm trying to insert a pattern if a pattern is found in a file.
This is my sample file
"PDA"|"Celvin"|"PRJ_NA"|"Completion_Units"|25
"PDA"|"Celvin"|"PRJ_AB"|"Completion_Units"|250
I would like to output as
"PDA"|"Celvin"|"PRJ_NA"|"Completion_Units"|"Done"|25... (3 Replies)
I'm writing a PHP script which will take a given media file and convert it into a flash (flv) file. In addition to this, once the flv file has been generated I create two thumbnails (of different sizes) from the newly generated flv file.
In order to do this I'm calling ffmpeg from the command... (4 Replies)
Hi,
I have an application where if it runs indivisually could able to execute commands (like system("ls")) and could able to execute tcl script.
Same application if started from health monitor process (From health monitor process my application will be forked), it could not execute the... (1 Reply)
hello all,
this topic might have been discussed but I couldn't find it with searching.
I am trying to do a for command that will dos2unix files one by one and save it under directory called backup (backup is in the same directory with other files). When I do:
for i in *
do
dos2unix $i... (5 Replies)