in reply to more problems running a program that hogs the termnial

Sounds like you could be running MS telnet?

Did you try kill 1, $pid or kill 9, $pid;?

I know that on Win32, most programs will terminate if they receive a SIGINT (2), but MS telnet doesn't. However, it will terminate on recieving signals 1 or 9.

If you're not on win32, or using telnet this may not apply.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco.
Rule 1 has a caveat! -- Who broke the cabal?

Replies are listed 'Best First'.
Re^2: more problems running a program that hogs the termnial
by GaijinPunch (Pilgrim) on Apr 15, 2005 at 04:59 UTC
    I'm running this script on Solaris 9. I tried kill 1 and kill 9 -- neither work. The script does absolutely nothing (including trying to kill it) untill the pid is killed. Hence, my delima. :(

      'k. Sorry for the bum steer. Strange though, if you can terminate the same program with ^C?

      You probably need to look at IPC::Open2 or maybe the Expect program?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco.
      Rule 1 has a caveat! -- Who broke the cabal?
      I tried kill 1 and kill 9 -- neither work.
      Then something's wrong. Signal 9 is SIGKILL. When a program is issued a SIGKILL, it must exit. The operating system ensures that. Nothing can trap a SIGKILL. Something tells me that you're not sending a signal to the correct process. How are you trying to issue the kill?

      thor

      Feel the white light, the light within
      Be your own disciple, fan the sparks of will
      For all of us waiting, your kingdom will come

        The kill is never executed... that's the point. I've got it in my script, but until something kills the pid created by the file handle, the script will not continue.
        It's not getting executed...that's the problem. The script will not go anywhere until the $pid is killed. In this case, I have to do it externeally or by typing quit in the terminal. Anyone can emulate this if they've got a Unix-ish system.
        my $pid = open(DUMP, "top|") || die $!; # or 'prstat' will work while ( <DUMP> ) { chomp; print "$_\n"; } kill 9, $pid;
        I tried using IOC::Open2, assuming I can write "quit" (which will kill the program) but since script isn't going anywhere...