Home Forums C Programming C programming Tricky Question!!

Viewing 0 reply threads
  • Author
    • #2234

      Hi All,

      I have a tricky question, I tried in different ways but I couldnt solve the problem.Solution to my problem would be greatly appreciated.

      I have a shell script which runs my process(start/stop).Now the problem is , I need to support the same process for different arguments.Suppose we have a binary named “super”, I need to run this process one each for different kind of arguments.
      Say , I have the following number of arguments :
      1) super -a1
      2)super -a2
      3)super -a3

      I have a script named super_net.pl, If I ran this script as
      1)super_net.pl start
      I need to run all the process(same binary(super) with different arguments(any of one a1 or a2 or a3))
      2)super_net.pl stop(I need to kill all the running(super) process)
      3)super_net.pl start xx
      (xx could be any one of the above arguments Ex: a1,a2,a3)
      depends on the argument, I need to check whether the process is already running, if so I need to kill that process and start the new one.
      4)super_net.pl start xx
      I need to stop the process(super) running with the xx argument.

      The problem here is how to store thr process IDs of each super process in the script ?(As script will exit once it has doen his work)

      Note: I cannot kill the process based on ps -auwwwxxx | grep super.


Viewing 0 reply threads
  • The forum ‘C Programming’ is closed to new topics and replies.