[comp.unix.questions] Problem piping "jobs"

schuetz@iraul1.ira.uka.de (Elmar Schuetz) (12/07/88)

Hello to the wizards in this group.

I want to "kill -9" the latest submitted job in a csh-environment.
I mean the job with the highest number. Note, this is not always "%+".

Therefore I tried to pipe "jobs" to "tail" and "awk" or "wc -l".

The problem: "jobs" does not result anything if piped. (Yes, there are jobs ...)
	Just try: jobs
	and	: jobs | cat
The last is always empty (under Ultrix 2.4 and SunOS 3.5).

If I could kill the job with the highest number another way I wouldn't care
about "jobs".

Any hints are appreciated.

Best regards, Elmar


Please reply by email and don't followup. I'll summarize.
	internet, csnet, ean: schuetz@ira.uka.de
	bitnet: <out of order>

mikej@tfli.UUCP (Michael R. Johnston) (12/11/88)

In article <733@iraun1.ira.uka.de> schuetz@iraul1.ira.uka.de (Elmar Schuetz) writes:
>I want to "kill -9" the latest submitted job in a csh-environment.
>I mean the job with the highest number. Note, this is not always "%+".

NOTE: Your last process does NOT necessarily have to be the highest numbered
process attached to your tty. In particular processes wrap around after
a certain point and start from the bottom again. 

This is one of those things that WILL work in the majority of cases. Your 
playing roulette if logged in as root though......



-- 
---
                Michael R. Johnston - @NET: mikej@cpmain.uucp
...{cmcl2!phri!,uunet!}dasys1!cpmain!mikej || ...!philabs!mergvax!cpmain!mikej