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


Groups > gnu.bash.bug > #16518

Re: ‘command … &’ creates subshell

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Robert Elz <kre@munnari.OZ.AU>
Newsgroups gnu.bash.bug
Subject Re: ‘command … &’ creates subshell
Date Thu, 02 Jul 2020 01:01:25 +0700
Lines 34
Approved bug-bash@gnu.org
Message-ID <mailman.785.1593626512.2574.bug-bash@gnu.org> (permalink)
References <k0znfddo.dag@gnui.org> <511886e8-2262-39ee-2a01-7d284e981cb1@archlinux.org> <tuysgrgt.dag@gnui.org> <pn9hipci.dag@gnui.org> <ac4a98bd-32f4-5c55-3b8f-1306e9758f54@case.edu> <7dvoi92p.dag@gnui.org> <09ea84b2-4fb1-6b05-7c0b-fe6b2ab00c6f@archlinux.org> <2643.1593599092@jinx.noi.kre.to> <24624.1593615917@jinx.noi.kre.to> <29344.1593626485@jinx.noi.kre.to>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1593626512 11481 209.51.188.17 (1 Jul 2020 18:01:52 GMT)
X-Complaints-To action@cs.stanford.edu
Cc Eli Schwartz <eschwartz@archlinux.org>, bug-bash@gnu.org
To Dmitry Alexandrov <dag@gnui.org>
Envelope-to bug-bash@gnu.org
In-Reply-To <k0znfddo.dag@gnui.org>
Received-SPF permerror client-ip=2001:3c8:9009:181::2; envelope-from=kre@munnari.OZ.AU; helo=munnari.OZ.AU
X-detected-operating-system by eggs.gnu.org: No matching host in p0f cache. That's all we know.
X-Spam_score_int -8
X-Spam_score -0.9
X-Spam_bar /
X-Spam_report (-0.9 / 5.0 requ) BAYES_00=-1.9, KHOP_HELO_FCRDNS=1, T_SPF_HELO_PERMERROR=0.01, T_SPF_PERMERROR=0.01 autolearn=_AUTOLEARN
X-Spam_action no action
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <29344.1593626485@jinx.noi.kre.to>
X-Mailman-Original-References <k0znfddo.dag@gnui.org> <511886e8-2262-39ee-2a01-7d284e981cb1@archlinux.org> <tuysgrgt.dag@gnui.org> <pn9hipci.dag@gnui.org> <ac4a98bd-32f4-5c55-3b8f-1306e9758f54@case.edu> <7dvoi92p.dag@gnui.org> <09ea84b2-4fb1-6b05-7c0b-fe6b2ab00c6f@archlinux.org> <2643.1593599092@jinx.noi.kre.to> <24624.1593615917@jinx.noi.kre.to>
Xref csiph.com gnu.bash.bug:16518

Show key headers only | View raw


    Date:        Wed, 01 Jul 2020 18:45:07 +0300
    From:        Dmitry Alexandrov <dag@gnui.org>
    Message-ID:  <k0znfddo.dag@gnui.org>

  | One could argue, that an ability to ignore builtin utilities actually adds
  | nothing to applicability of a script to different (unknown a priory)
  | environments.

One can indeed (sometimes when someone a point like that, I reply that one
can argue almost anything, it is not whether one can argue it or not that
matters, but whether one wins the argument - that is succeeds in convincing
people that one is correct) - but I won't do that here, as I don't disagree.

The lack of an easy method to force execution of a command from the
filesystem is very likely because there is generally no reason to do
that.   That is, no-one ever really wanted it, so no method was invented.

However, for whatever reason, people keep asking how.  Either by directly
asking the question, or by picking one of the popular (but incorrect)
methods, and either claiming it works, or complaining when it doesn't.

As best I can tell, other than doing a search of PATH, and then using the
full path name (which is what $(type -P cmd) does in bash, more succinctly
than shells that don't have this -P option to type), the most reliable,
that is, which is 99.99999% unlikely to accidentally invoke a builtin, is

	gdb cmd
	run <args>

but putting that in a script would be absurd.

kre

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


Thread

Re: ‘command … &’ creates subshell Robert Elz <kre@munnari.OZ.AU> - 2020-07-02 01:01 +0700

csiph-web