Path: csiph.com!goblin3!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Robert Elz Newsgroups: gnu.bash.bug Subject: Re: =?UTF-8?B?UmU6IOKAmGNvbW1hbmQg4oCmICbigJkgY3JlYXRlcyBzdWJzaGVsbA==?= Date: Wed, 01 Jul 2020 22:05:17 +0700 Lines: 37 Approved: bug-bash@gnu.org Message-ID: References: <511886e8-2262-39ee-2a01-7d284e981cb1@archlinux.org> <7dvoi92p.dag@gnui.org> <09ea84b2-4fb1-6b05-7c0b-fe6b2ab00c6f@archlinux.org> <2643.1593599092@jinx.noi.kre.to> <24624.1593615917@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 1593615985 4491 209.51.188.17 (1 Jul 2020 15:06:25 GMT) X-Complaints-To: action@cs.stanford.edu Cc: Dmitry Alexandrov , bug-bash@gnu.org To: Eli Schwartz Envelope-to: bug-bash@gnu.org In-Reply-To: <511886e8-2262-39ee-2a01-7d284e981cb1@archlinux.org> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:3c8:9009:181::2 (failed) 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: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, RDNS_NONE=0.793, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <24624.1593615917@jinx.noi.kre.to> X-Mailman-Original-References: <511886e8-2262-39ee-2a01-7d284e981cb1@archlinux.org> <7dvoi92p.dag@gnui.org> <09ea84b2-4fb1-6b05-7c0b-fe6b2ab00c6f@archlinux.org> <2643.1593599092@jinx.noi.kre.to> Xref: csiph.com gnu.bash.bug:16509 Date: Wed, 1 Jul 2020 07:54:05 -0400 From: Eli Schwartz Message-ID: <511886e8-2262-39ee-2a01-7d284e981cb1@archlinux.org> | Indeed -- that's why I specifically used the bashism $(type -P ...) as | type -P forces the printing of an external file executable. Yes, saw that, that method would work, I was commenting only upon the use of "command" with the intent of executing a file. | Regarding use of env, I presume you're referring to the busybox behavior | here, Or anything similar. env is an entirely reasonable command to build in, it is doing very shell like operations, so any shell (including bash as a loadable builtin I'd assume, but I don't do that kind of think to bash so I don't know for sure) could build in env, and as soon as it is built in it can run other built in commands (nothing in its spec forbids any of that). | so shouldn't env be safe to use as such, if you know: [...] If you know all that, then you also know what is builtin, and that if you say just "ls" or "awk" the external command will be run, as there is no other possibility ("will be" assuming they're found in the current PATH of course). Similarly you probably know that /bin/cat works. The whole point of trying to find a technique like was hoped for using command, and others have used env for, and still others, (exec command) (none of which are guaranteed to work) is so that the script will work with different shells and in different environments. kre