Subject: Re: Do test-path_is_{file,dir,exists} make sense anymore with -x?

From: Matthieu Moy <[email-masked]>
Date: Tue, 26 Feb 2019 18:48:43 +0100

SZEDER Gábor <[email-masked]> writes:

> On Tue, Feb 26, 2019 at 05:10:30PM +0100, Ævar Arnfjörð Bjarmason wrote:
>> However. I wonder in general if we've re-visited the utility of these
>> wrappers and maybe other similar wrappers after -x was added.
>
>> But 4 years after this was added in a136f6d8ff ("test-lib.sh: support -x
>> option for shell-tracing", 2014-10-10) we got -x, and then with "-i -v -x":
>
> '-x' tracing doesn't work in all test scripts, unless it is run with a
> Bash version already supporting BASH_XTRACEFD, i.e. v4.1 or later.
> Notably the default Bash shipped in macOS is somewhere around v3.2.

According to http://www.tldp.org/LDP/abs/html/bashver4.html#AEN21183,
bash 4.1 was released on May, 2010. Are you sure macOS is _that_ late?

I also tried with dash, and -x seems to work fine too (I use "works with
dash" as a heuristic for "should word on any shell", but it doesn't
always work).

If -x doesn't work in some setups, it may be a good reason to wait a bit
before trashing test_path_is_*, but if it's clear enough that the vast
majority of platforms get -x, then why not trash these wrappers indeed.

-- 
Matthieu Moy
https://matthieu-moy.fr/