Re: control-C issue running binary



On Sun, 29 Jan 2006 00:02:25 GMT, Mick Limprecht wrote:
> I have a java command line program that runs another linux binary
> executable as one of it's functions.

[...]

> This all works fine. The problem I have is the binary has it's own
> command line interface so when a control-C is entered while the binary
> is running it will stop (not exit) what it is doing at that point so
> you can interact with program through it's own command line (set
> variables, change parameters, step, etc).

When you type ctrl-c in a console where an application is running, the
program does not "read a ctrl-c character", so there's nothing you can
send through the stream to cause the same effect.

What happens is that ctrl-c is interpreted by the console driver,
which then sends a signal (usually SIGINT) to all of the processes in
the process group of the foreground process.

You can do something similar with "kill -INT <pid>" or "kill -INT
<process group>". Read the man page for kill.

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
.



Relevant Pages

  • Re: csh/sh SIGINT differences (was: Re: Background processes from a script)
    ... > whether or not the command is run as a result of command-substitution, ... I don't believe that these signals should be sent by bash in the first ... This should be amended to "all processes in their process group whose ... terminal process group equals the current terminal process group". ...
    (comp.unix.shell)
  • Re: Recursive renice?
    ... > of its children in one simple command. ... > someone had made a sed script, but it's for linux, where the pstree ... That's what 'renice -g pgrp' is for. ... the process group includes your ...
    (freebsd-questions)
  • ksh93 - Ctrl-c of fgd output producing job causes shell to be stuck
    ... script log yes & # runs only in fg, ... In ksh93, however, after Ctrl-c, nothing is echoed or blind typing ... Sending a signal to the above script command running does not cause ... the terminal/keyboard? ...
    (comp.unix.shell)
  • Re: ctrl-C not working...
    ... I've got several SGI's that I administer, and on some in my account ... > I'm able to ctrl-c out of a command. ...
    (comp.sys.sgi.admin)
  • Re: ctrl - c not working in pipe
    ... 0x3 is just a value - it doesn't trigger a signal unless the OS ... receives a command to send a signal. ... the signal that Ctrl-C would. ... Getting the PID can be cumbersome, and writing the PID to a file may be ...
    (comp.lang.java.programmer)