bug-bash
[Top][All Lists]
Advanced

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

Re: ‘command … &’ creates subshell


From: Robert Elz
Subject: Re: ‘command … &’ creates subshell
Date: Thu, 02 Jul 2020 01:01:25 +0700

    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




reply via email to

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