bug-bash
[Top][All Lists]
Advanced

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

Re: `jobs` shows output even when nothing has been started in the backgr


From: Chet Ramey
Subject: Re: `jobs` shows output even when nothing has been started in the background
Date: Fri, 16 Jun 2023 14:30:54 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0

On 6/14/23 6:12 PM, Ajeet D'Souza wrote:
Hey Chet,

Thanks for the quick reply. I have some follow-up questions:

  * Is there an elegant way I can start an external process without it
    showing up under jobs, even on affected versions? My current best idea
    is: (_="$(/bin/echo)"; jobs -l)

You can try to disown it.

  * Is there an elegant way I can get the correct number of jobs, even on
    affected versions? My current best idea is to run jobsonce before doing
    the count: (jobs &> /dev/null; jobs | wc -l)

You have to get the jobs you're not interested in removed from the jobs
table. That's as good a way as any if you don't know the job number or
if it's not the current job.


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




reply via email to

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