On 7/24/20 5:47 AM, Geoff Clare wrote:
> Martijn Dekker <mart...@inlv.org> wrote, on 23 Jul 2020:
>>
>> Op 23-07-20 om 14:47 schreef Geoff Clare:
>>> Not according to a quick test I just did.  The only shell that I tried
>>> which won't do job control in a subshell is zsh in its default
>>> environment; with "emulate sh" it does.
>>>
>>> $ for shell in bash dash ksh mksh zsh; do echo $shell ...; $shell -c
>>> 'set -m; (sleep 2 & jobs; wait %%)'; done
>> On the vast majority of shells, 'wait %%' works without job control, so that
>> is not a correct test.
> 
> The output of the "jobs" command, which you have omitted, showed that
> a job ID had been assigned, which I took to be an indication that job
> control was not disabled.  However, I now see that shells (misleadingly)
> do that when job control actually is disabled (with set +m) as well.

If you want `kill' to be able to accept job IDs even when job control is
not enabled, you'd better assign a job number. There's no language that
restricts the valid IDs to `%%'.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to