bug-bash
[Top][All Lists]
Advanced

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

Re: [PATCH v2 5/8] builtins/source: parse the -i option


From: Chet Ramey
Subject: Re: [PATCH v2 5/8] builtins/source: parse the -i option
Date: Mon, 20 May 2024 16:04:17 -0400
User-agent: Mozilla Thunderbird

On 5/19/24 6:31 AM, Matheus Afonso Martins Moreira wrote:

There is absolutely no doubt that this is useful.
Not long after I sent the patches, a list of about
a dozen projects implementing module loading
and management in bash was posted.
Clearly this is something people want.

I think the point of that list was to demonstrate that there already exist
solutions to this request, that they have existed in some form for many
years, and your solution would have to accommodate them, or at least learn
from them, in some way.

It cannot be done some other way.
Not without running into limitations.

Obviously these limitations have not proved fatal this far. That doesn't
mean they're irrelevant, only that they're not insurmountable.


That one is simple ... when it ('.' in sh, "source" in csh) was added
there were no functions, while read & eval might have been enough for
  simple one line scripts, they wouldn't work for more complex ones, to
  invent your own '.' command that way you'd need to do it in a moderately
  complex function, which didn't exist at the time.

At the very least you would have had to do something like

data="`cat filename`"
eval "$data"

every time you wanted to source a file.


Well all those components exist now.
Why not use them instead of source?

Because source/. exists, is required, and is not going away. Why not use
it?



I agree that modifying PATH isn't a great solution

Discussing this matter always seems to end like this.
I can't figure out if people actually agree with me or not.
Apparently I'm right but the feature _still_ shouldn't be
added because of reasons I can't seem to understand.

Because the current behavior is understood, and other people don't see a
great enough advantage to use something else.

generally only improves the status quo,

I don't think everyone agrees with this. Certainly it's disputed even in
the discussion here.

--
``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/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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