[Top][All Lists]

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

Should $(fg) resume a stopped job?

From: Oğuz
Subject: Should $(fg) resume a stopped job?
Date: Fri, 31 Jul 2020 09:03:56 +0300

    $ sleep 25
    [1]+  Stopped                 sleep 25
    $ echo $(fg; jobs %)
    bash: jobs: %: no such job
    sleep 25
    $ jobs
    [1]+  Running                 sleep 25 &

What I gather from this is that bash fakes interactive job control in
command substitution context, because otherwise `fg' wouldn't return
immediately. But I don't see any point in that `fg' resumes the stopped job
when it's faked. Is this a bug or a deliberate choice?


reply via email to

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