[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: jobs built-in command and PROMPT_COMMAND
From: |
Jesse Hathaway |
Subject: |
Re: jobs built-in command and PROMPT_COMMAND |
Date: |
Fri, 1 Oct 2021 09:30:04 -0500 |
On Fri, Oct 1, 2021 at 8:22 AM Greg Wooledge <greg@wooledge.org> wrote:
> I think you're looking for this:
>
> checkjobs
> If set, bash lists the status of any stopped and running
> jobs before exiting an interactive shell. If any jobs
> are running, this causes the exit to be deferred until a
> second exit is attempted without an intervening command
> (see JOB CONTROL above). The shell always postpones ex‐
> iting if any jobs are stopped.
This doesn't seem to work for me, what am I doing wrong?
$ INPUTRC=/dev/null bash --norc
bash-5.1$ shopt -s checkjobs
bash-5.1$ sleep 30 &
[1] 461671
bash-5.1$ jobs
[1]+ Running sleep 30 &
bash-5.1$ exit
exit