Re: comments inside command subst are handled inconsistently

2023-07-31 Thread Denys Vlasenko
On 7/28/23 19:51, Martin D Kealey wrote: On the other hand, since everyone has now had 36+ years to update their scripts to get rid of backticks, I don't know about others, but I missed the memo that `` is deprecated. Please do not break compatibility. The importance of compatibility is some

Re: comments inside command subst are handled inconsistently

2023-07-31 Thread G. Branden Robinson
Hi Denys, At 2023-07-31T13:38:00+0200, Denys Vlasenko wrote: > On 7/28/23 19:51, Martin D Kealey wrote: > > On the other hand, since everyone has now had 36+ years to update > > their scripts to get rid of backticks, > > I don't know about others, but I missed the memo that `` is > deprecated. T

Re: comments inside command subst are handled inconsistently

2023-07-31 Thread Chet Ramey
On 7/31/23 7:38 AM, Denys Vlasenko wrote: In the spirit of increased compatibility across Unix world, it'd be quite useful if shells stop inventing incompatible "extensions". That's an excellent way to stifle innovation. The "function" keyword, for example. Why does it even exists? You're

Re: comments inside command subst are handled inconsistently

2023-07-31 Thread Chet Ramey
On 7/31/23 8:22 AM, G. Branden Robinson wrote: [John Mashey, the author of the predecessor Unix shell (and successor to Ken Thompson's original Unix shell) has gone on record as "goading" Bourne into doing questionable things in the quest for speed. This is true. Mashey's v6 she

Re: comments inside command subst are handled inconsistently

2023-07-31 Thread Chet Ramey
On 7/30/23 2:21 PM, Martin D Kealey wrote: Seriously though, the internet is awash with "helpful" Shell guides and examples loaded with poor practices. The only way this is going to improve is if there's a "linting mode" is included in the Shell and on by default. Does shellcheck warn about f

Re: [PATCH] fix bind -X quoting

2023-07-31 Thread Chet Ramey
On 7/26/23 5:57 PM, Grisha Levit wrote: It's just not transitive. Another issue I didn't think of with printing the unquoted translated command is that it can include newlines, which is a problem since you have to read the `bind -X' output one line at a time to reuse it with `bind -x'. If th

Re: Tilde (~) in bash(1) is typeset incorrectly as Unicode character

2023-07-31 Thread Chet Ramey
On 7/29/23 10:05 PM, Bjarni Ingi Gislason wrote: Simply add .if t .tr ~\(ti to "tmac/an.tmac", instead of changing (hard coding) it in the sources (man pages). This is probably excellent advice for the distros, but not something bash is going to do. -- ``The lyf so short, the craft so

Re: [PATCH] fix bind -X quoting

2023-07-31 Thread Chet Ramey
On 7/31/23 9:30 AM, Chet Ramey wrote: On 7/26/23 5:57 PM, Grisha Levit wrote: It's just not transitive. Another issue I didn't think of with printing the unquoted translated command is that it can include newlines, which is a problem since you have to read the `bind -X' output one line at a

Re: comments inside command subst are handled inconsistently

2023-07-31 Thread Denys Vlasenko
On 7/31/23 15:07, Chet Ramey wrote: On 7/31/23 7:38 AM, Denys Vlasenko wrote: In the spirit of increased compatibility across Unix world, it'd be quite useful if shells stop inventing incompatible "extensions". That's an excellent way to stifle innovation. There is no reason to innovate in

Re: [PATCH] normalization tweaks for macOS

2023-07-31 Thread Chet Ramey
On 7/25/23 4:06 PM, Grisha Levit wrote: On Mon, Jul 24, 2023 at 10:12 AM Chet Ramey wrote: On 7/20/23 7:52 PM, Grisha Levit wrote: I wonder if you'd be interested in changes to the function that would skip escaping ASCII characters that aren't glob-special as well. I _think_ it would just b

Re: [PATCH] fix bind -X quoting

2023-07-31 Thread G. Branden Robinson
At 2023-07-31T09:30:30-0400, Chet Ramey wrote: > Rather than embed more and more shell-specific output formats that > readline doesn't parse into readline itself, I'm more inclined to add > a hook to allow an application to print the value of a key binding > itself. [...] > This would allow us, for

Re: comments inside command subst are handled inconsistently

2023-07-31 Thread G. Branden Robinson
At 2023-07-31T16:08:31+0200, Denys Vlasenko wrote: > There is no reason to innovate in tools such as sed, awk, or sh. These are terrible examples to use; look at the history of all three. > They have fossilized. No, they've been _standardized_. POSIX acknowledges that the common set of expected

Re: [PATCH] fix bind -X quoting

2023-07-31 Thread Chet Ramey
On 7/31/23 11:51 AM, G. Branden Robinson wrote: At 2023-07-31T09:30:30-0400, Chet Ramey wrote: Rather than embed more and more shell-specific output formats that readline doesn't parse into readline itself, I'm more inclined to add a hook to allow an application to print the value of a key bindi

A few suggestions for the GNU Manual

2023-07-31 Thread Wiley Young
Hi, Regarding the "Invoking Bash" page, https://www.gnu.org/software/bash/manual/html_node/Invoking-Bash.html It might be more consistent and therefore perhaps more clear for all of the newbies out there if the description of "--restricted" also began with "Equivalent to -r," as the very next des

Re: [PATCH] normalization tweaks for macOS

2023-07-31 Thread Grisha Levit
On Mon, Jul 31, 2023, 10:32 Chet Ramey wrote: > On 7/25/23 4:06 PM, Grisha Levit wrote: > > Re latest changes in [1], we need to preserve quoting also for any of > > the following characters, at least if they are in a bracket > > expression: > > ! - . : = ^ > > Why not just quote them all the tim

Re: comments inside command subst are handled inconsistently

2023-07-31 Thread Ángel
On 2023-07-31 at 09:15 -0400, Chet Ramey wrote: > On 7/30/23 2:21 PM, Martin D Kealey wrote: > > > Seriously though, the internet is awash with "helpful" Shell guides > > and > > examples loaded with poor practices. The only way this is going to > > improve > > is if there's a "linting mode" is

[PATCH] fix getconf builtin ifdef's

2023-07-31 Thread Grisha Levit
The changes to getconf.c in 829aad36 (submitted in https://savannah.gnu.org/patch/?10367) seem to have a typo. Should likely be: diff --git a/examples/loadables/getconf.c b/examples/loadables/getconf.c index af5544f0..f3f1ffcd 100644 --- a/examples/loadables/getconf.c +++ b/examples/loadables/getc

[PATCH] fix getconf pathconf arg validation

2023-07-31 Thread Grisha Levit
$ getconf LINK_MAX bash: getconf: pathconf LINK_MAX: (null): Bad address undefined diff --git a/examples/loadables/getconf.c b/examples/loadables/getconf.c index f3f1ffcd..285f1b63 100644 --- a/examples/loadables/getconf.c +++ b/examples/loadables/getconf.c @@ -1059,12 +1059,12 @@ getconf_one (WOR

[PATCH] getconf CHAR_BIT -> CHAR_MAX

2023-07-31 Thread Grisha Levit
$ getconf -a | grep CHAR_BIT CHAR_BIT 8 CHAR_BIT 255 --- diff --git a/examples/loadables/getconf.c b/examples/loadables/getconf.c index 285f1b63..b0a854c8 100644 --- a/examples/loadables/getconf.c +++ b/examples/loadables/getconf.c @@ -125,7 +125,7 @@ static const struct conf vars[] = #ifdef _SC_C