system command

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jain236
    New Member
    • Jul 2007
    • 36

    system command

    Hi all
    i have a cgi which has ping and stop button when i click it sends system ('ping 126.56.36.80 -t') which continously get the ping status of the ip until we send CTRL+c , but when i click stop button in need to send CTRL+C command , how can we achive this?or else how can we kill the process running?


    thanking you in advance
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Why not use the -c option to limit the count (# of pings) to a specific number. That way, it kills itself.

    Regards,

    Jeff

    Comment

    • eWish
      Recognized Expert Contributor
      • Jul 2007
      • 973

      #3
      perlfaq8 "How do I make a system() exit on control-C?"
      perllipc

      --Kevin

      Comment

      • KevinADC
        Recognized Expert Specialist
        • Jan 2007
        • 4092

        #4
        Originally posted by jain236
        Hi all
        i have a cgi which has ping and stop button when i click it sends system ('ping 126.56.36.80 -t') which continously get the ping status of the ip until we send CTRL+c , but when i click stop button in need to send CTRL+C command , how can we achive this?or else how can we kill the process running?


        thanking you in advance
        You will have to find the process ID and then kill it if you really want to do something like this. You can maybe do that with perl if your system allows you access stuff like ps and kill from your account.

        Comment

        Working...