[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The 'source x' command doesn't keep variables set by x when source o
From: |
Martin D Kealey |
Subject: |
Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command |
Date: |
Mon, 18 Nov 2024 15:55:53 +1000 |
On Sun, 17 Nov 2024, 03:32 Chet Ramey, <chet.ramey@case.edu> wrote:
> On 11/16/24 3:36 AM, Martin D Kealey wrote:
> I don't think a disclaimer saying "this manual is not what it does not
> claim to be" is particularly useful.
>
That's valid, but how else do we get people to read the correct document
for their skill level, when their self-assessment will invariably be wrong?
How can we reasonably expect users to assess their own skill level and
choose a 'tutorial' when their instincts are telling them "yep I understand
almost all of this stuff"?
The Shell language *looks* simple, while actually being one of the most
complex languages in common use, and its multitude of subtle fishhooks
effectively turns half the populace into Dunning-Kruger sufferers.
Moreover, we are complicit in this: every new feature added to Bash makes
it more useful, more attractive to new users.
The morally right thing to do would be to shoo them away, not attract them.
In the meantime we owe them a duty of care.
I've used Bash for about 30 years, and even I have to wonder whether the
Shell manual should start with this warning instead:
"
*If you're writing a new script from scratch, STOP NOW, and go and choose a
different language - ANY language. No matter what you choose, it will be a
better choice than the Shell language.*
*The Shell language makes bad coding easy, and good coding hard, so almost
everything you write will turn out to have bugs that may lurk for years
before biting you - or your successor.** It lacks sane error handling. It
lacks sane variable scopes. It lacks data structures. It lacks modules. It
looks like other languages, but doesn't behave like them.*
*And in case you're wondering, no, Bash can't be changed to make a saner
language, because it has to meet the POSIX standard, as well as 40 years of
backwards compatibility.*
*Don't say we didn't warn you.*
*(But don't simply choose a different implementation of the Shell; that
would be worse.)*"
-Martin
>
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, (continued)
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, #!microsuxx, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Greg Wooledge, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Martin D Kealey, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Yuri, 2024/11/14
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Chet Ramey, 2024/11/14
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Martin D Kealey, 2024/11/15
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Robert Elz, 2024/11/16
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Martin D Kealey, 2024/11/16
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Oğuz, 2024/11/16
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Chet Ramey, 2024/11/16
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command,
Martin D Kealey <=
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Oğuz, 2024/11/18
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Chet Ramey, 2024/11/19
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Robert Elz, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, #!microsuxx, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Yuri, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, #!microsuxx, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, #!microsuxx, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Robert Elz, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Chet Ramey, 2024/11/14
Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Chet Ramey, 2024/11/14