bug-bash
[Top][All Lists]
Advanced

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

Re: bash turns off job_control when non-interactive, but also more..


From: Chet Ramey
Subject: Re: bash turns off job_control when non-interactive, but also more..
Date: Mon, 19 Apr 2004 15:00:01 -0400

> We have some UNIX conformance test suites which are failing, specifically
> they're failing on the %% job argument essentially as follows:
> 
> #!/bin/bash
> cat &
> kill -1 %% && echo I killed it || echo could not kill it
> 
> If you run this script, it will emit an error saying the %% argument to kill
> is invalid and it could not kill the job.  Looking into builtins/kill.def,
> you see that it specifically checks interactive and job_control (both of which
> are 0 in the case of a shell script) and disables the code which would expand
> the %% form in the script.  Are you sure this is correct?  The Open Group,
> which uses this in a number of its job control test scripts, doesn't
> appear to think so...  Thanks!

I'll take a look.  I don't know who was smoking what when it was decided
that `kill', for instance, can arbitrarily use job control job id notation
whether or not job control is active.  Maybe it's enough to return
reasonable results for `%%' and `%+', since the shell keeps track of that
information anyway.

(All job control shells disable job control by default in non-interactive
shells and require that it be explicitly enabled.)

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    chet@po.cwru.edu    http://tiswww.tis.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]