Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: =?UTF-8?B?T8SfdXo=?= Newsgroups: gnu.bash.bug Subject: Re: Should $(fg) resume a stopped job? Date: Fri, 31 Jul 2020 19:43:14 +0300 Lines: 43 Approved: bug-bash@gnu.org Message-ID: References: <08840792-f5f6-34b1-ca5a-81e5488eba36@case.edu> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1596213801 14815 209.51.188.17 (31 Jul 2020 16:43:21 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash To: "chet.ramey@case.edu" Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0Nfy0qU4LTSpzJRj31jjToMaTDIwsk6anAwsVkITRgs=; b=EQaH1L09OAolxyiqYKnTEV8L+X8oyCJJ7IBWd9MSA7WOUKq6loqA0v58xQQ/JLoSuu L0c575U9A0gOq43Qgl1sJSQghSiGIK36+/v61FuaRu3vwWIaE7xIKor4EN1Q0Z3mqObg 7JCYLhZRtdj8pJXmht1ArBaOnfFxd0DaH/aIpsOxRfpGUFghdOya4c+dHiMtYfES3B+n BmGSynJxoO7564WvWm2CeZdFMwKklSPWLGFdrhFbedDeBxAS3sIVI4b1w33JhsByjvQz CrHLt/bQ0BmoM0cF27iUDIZIPINjHjbOuEMzad3LYw3YXcZt9BH0CvnGfyTHSo6PQDXz cAZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0Nfy0qU4LTSpzJRj31jjToMaTDIwsk6anAwsVkITRgs=; b=bfCFvNn8ANGk85ClefdDYBGoZn0A7ZT/z+jx40Rhg6JtObpOcEEuYE5HGCroTjUK5x aX7nxKptlb+2oPtVzOz7tl1PipspXCxGF6AdtrZ+/6pGdC8XX8Bsy1YsIFGpeS8UWBW4 dzPZviVo3SW99zfZ1dcev+BoGklXxd8s1kDeMh8XVlUXXm5l5NGnbhc1acRmSzLeMSWp Ji3LAnwbvNlAkI9WivdJGMvClVrCpUcXsWQHo/D716eMp55HK2FkML6fRKJIiUqK4Sa2 dz+56Hl4/Q5i7FupxVHCj4f5pjvkjIrrAI5vIQUT6T6UsRq4x1GiUy5N3ib3vCFscAOx bNMg== X-Gm-Message-State: AOAM5326mDMjkMEJa98MHDrrnvV97YejfLa+2wjm44HIeRcgL5NzdZFV f+ToakEccWDPTQjK44vWn7puUN/J0IOlxr9XFDo= X-Google-Smtp-Source: ABdhPJzjnaYtKSUy7Vmhz1YW4upymR/iu3jU65WrvIZqKmtSo5iWvsFMDweYJaU4Uo4ASL+PrR4ksI3qSJAJXJPZhE4= X-Received: by 2002:a37:56c7:: with SMTP id k190mr5163102qkb.329.1596213795119; Fri, 31 Jul 2020 09:43:15 -0700 (PDT) In-Reply-To: <08840792-f5f6-34b1-ca5a-81e5488eba36@case.edu> Received-SPF: pass client-ip=2607:f8b0:4864:20::732; envelope-from=oguzismailuysal@gmail.com; helo=mail-qk1-x732.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <08840792-f5f6-34b1-ca5a-81e5488eba36@case.edu> Xref: csiph.com gnu.bash.bug:16666 31 Temmuz 2020 Cuma tarihinde Chet Ramey yazd=C4=B1: > On 7/31/20 2:03 AM, O=C4=9Fuz wrote: > > $ 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? > > Maybe a minor bug, but certainly a choice. The command substitution keeps > the jobs list around, since the subshell is supposed to be an exact copy = of > the parent, and it's useful to get the output of `jobs' out of command > substitution. > > You just can't expect to do anything with any of those jobs, since the > command substitution shell is not the parent of any of them. It would > make sense to have `fg' complain about that. > > Right, it would. bosh behaves the same way as bash btw. > -- > ``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/ > --=20 O=C4=9Fuz