[comp.sys.amiga] The other half of RUN!

markr@garfield.UUCP (08/11/87)

   The first thing you make in a multi-tasking DOS like AmigaDOS is
RUN. (A very nice command!) The next one is KILL. (Excuse me? No kill
command?) 

   I want to be able to say kill task 2 and have what ever task 2 is
or was to end and go away! If you can make or have such a command that
I can add to my C dir please post it to this group. 


   Thanks

  Joseph Robert Dawson
  NOT: Mark Dawson

daveh@cbmvax.UUCP (Dave Haynie) (08/14/87)

in article <3873@garfield.UUCP>, markr@garfield.UUCP (Mark Dawson) says:
> 
>    The first thing you make in a multi-tasking DOS like AmigaDOS is
> RUN. (A very nice command!) The next one is KILL. (Excuse me? No kill
> command?) 
> 
>    I want to be able to say kill task 2 and have what ever task 2 is
> or was to end and go away! If you can make or have such a command that
> I can add to my C dir please post it to this group. 

Without complete resource tracking, a task can't just be indiscriminantly 
killed.  However, since all tasks are likely to know how to shut themselves
down, there's already a command that works very much like the KILL command
you propose.  It's the Break command.  You'd type something like:

	1> Break task 3 e

What this will do is set the ^E signal in task 3 (you could also specify the
^C, ^D, or ^F signals).  A properly written program will see this via either
a polling or an exception, and shut itself down.  Try this with the Dir
command, which responds to ^C.  Start up a background Dir (in it's own window
to make things easier on yourself), like:

	1> run Dir >con:10/10/200/100/DirWindow opt a
	[CLI 2]

And you see Dir chugging away in it's window.  If you then type:

	1> break task 2 c

you'll shut down the Dir window as Dir responds to the ^C signal.  And that's
really all there is to it.  Not as powerful as a UN*X "kill -9", since the
task being killed must cooperate, but useful nonetheless.

>   Joseph Robert Dawson
>   NOT: Mark Dawson
-- 
Dave Haynie     Commodore-Amiga    Usenet: {ihnp4|caip|rutgers}!cbmvax!daveh
"The A2000 Guy"                    PLINK : D-DAVE H             BIX   : hazy
     "I'd rather die while I'm living, than live while I'm dead"
						-Jimmy Buffett

peter@sugar.UUCP (Peter da Silva) (08/20/87)

Apart from some (not all) of the tools that come with the machine, I haven't
seen a single properly written program. Not :->.
-- 
-- Peter da Silva `-_-' ...!seismo!soma!uhnix1!sugar!peter (I said, NO PHOTOS!)