On Fri, 17 May 2024 at 04:18, Chet Ramey <chet.ra...@case.edu> wrote:

> On 5/16/24 11:54 AM, G. Branden Robinson wrote:
> > At 2024-05-16T11:36:50-0400, Chet Ramey wrote:
> >> On 5/15/24 6:27 PM, Robert Elz wrote:
> >>> and any attempt to use a relative path (and you
> >>> can exclude ./anything or ../anything from that if you prefer - ie:
> >>
> >> Those are not relative paths.
> >
> > !
> >
> > POSIX 1003.1-202x/D4, §3.311 defines "relative pathname" thus:
> >
> > "A pathname not beginning with a <slash> character."
> >
> > Can you clarify?  Does Bash have its own definition of this term?
>
> In this specific case, I suppose. In default mode, `source' doesn't use
> $PATH for ./x and ../x, but does for other relative pathnames.
>

I assumed that "default mode" means "not posix mode", but if so that
doesn't hold up:

$ mkdir tmp/a
$ cat >tmp/a/b
echo in B
$ ( PATH=$PWD/tmp/a source b )
in B
$ ( PATH=$PWD/tmp source a/b )
bash-latest: a/b: No such file or directory
$ echo $BASH_VERSION
5.3.0(2)-alpha
$ ( p=$( realpath "$0" ) ; echo "git commit ${p##*/bash/}" )
git commit aadb6ffb93359891760c58008539f549f06c5140/bin/bash
$ shopt -o posix
posix           off

-Martin

Reply via email to