[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: killing jobs in ex



>>>>>  T Anthony Allen <anthony@tony.worldbank.org> writes:

Tony> Using es on Solaris, I cannot kill a job. Control-C does not work and
Tony> neither does the kill command. Checking the man page, there is no kill
Tony> primitive that I find.

Strange.  On my system, the man page is in /usr/man/man/kill.1.

That kill does not work on Solaris is, however, a well known (to me,
at least) bug.  /bin/kill is the following one-line script:

/bin/sh -c "kill $*"

and if you run it, the result is

/bin/kill: Exec format error

That is of course correct, as the script does not begin with the
standard #! line.  Besides, the script is totally silly, as it is
supposed to be run by sh, which has kill built-in -- and it definitely
does not need to fork and exec _another_ sh to do the job!

If you have root access, you might replace /bin/kill with the
following two-line script:

#! /bin/sh --
kill "$@"

or if not, you might do as I do, and put the following in your .esrc:

## @@@	Work around silly Solaris bug.
{ kill -l >/dev/null >[2=1] } || {fn kill {sh -c <={%flatten ' ' kill $*}}}

Now, to the other issue, that of Control-C not working:  Try running
this little experiment:

; /bin/stty -a
speed 9600 baud; 
rows = 24; columns = 80; ypixels = 316; xpixels = 580;
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^|; erase = ^?; kill = ^u;

I deleted the following lines of output.  If it doesn't say intr = ^c
there, you need to run {stty intr '^c'} upon login.

You may also want to review the section about signals in the es manual.

Good luck!

- Harald