bug-bash
[Top][All Lists]
Advanced

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

Re: [PATCH 0/4] Add import builtin


From: Chet Ramey
Subject: Re: [PATCH 0/4] Add import builtin
Date: Wed, 8 May 2024 10:02:20 -0400
User-agent: Mozilla Thunderbird

On 5/8/24 7:09 AM, Matheus Afonso Martins Moreira wrote:

In these discussions we've managed to
discover at least two *concrete* reasons
why it should actually be a builtin.

  - It can avoid touching PATH.
    Pure shell import cannot.

  - It's compatible with restricted shells.
    Most module managers resolve the path
    and pass in absolute file names, as you noted.

Neither of these requires a new builtin command. They require changes to
the shell, since they differ from existing functionality, but those changes
don't have to take the form of a builtin.

The number of lines being 203 is definitely large.

Definitely large? I don't know about that.
I even split it up into logical changes.

It takes less than a dozen lines of code to implement BASH_SOURCE_PATH.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

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