Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16652

Should $(fg) resume a stopped job?

From Oğuz <oguzismailuysal@gmail.com>
Newsgroups gnu.bash.bug
Subject Should $(fg) resume a stopped job?
Date 2020-07-31 09:03 +0300
Message-ID <mailman.362.1596175480.2739.bug-bash@gnu.org> (permalink)
References <CAH7i3Lr72e4Bn3q-Ywn6vnyvT9gx4wTCe6Q9tLAVHV-L7ufhrw@mail.gmail.com>

Show all headers | View raw


    $ sleep 25
    ^Z
    [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?

Oğuz

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Should $(fg) resume a stopped job? Oğuz <oguzismailuysal@gmail.com> - 2020-07-31 09:03 +0300

csiph-web