Re: Parameter expansion with extended pattern make system hang

2022-09-06 Thread Martin Schulte
Hi! > Running with this assumption, now that we know bash's extglob matching > will not perform suitably for this task, we can look at other approaches. Here's another: printf -- '%s ' $(gcc --help) | sed 's/ $/\n/' Let just do the shell most of the work ;-) Best regards, Martin

Re: Parameter expansion with extended pattern make system hang

2022-09-06 Thread Greg Wooledge
On Tue, Sep 06, 2022 at 11:55:52AM -0400, Chet Ramey wrote: > On 9/4/22 10:48 PM, Hyunho Cho wrote: > > > Bash Version: 5.1 > > Patch Level: 16 > > Release Status: release > > > > ## > > > > > > "gcc --help" is already a short

Re: Parameter expansion with extended pattern make system hang

2022-09-06 Thread Greg Wooledge
On Tue, Sep 06, 2022 at 10:11:00PM +0200, Martin Schulte wrote: > Hi! > > > Running with this assumption, now that we know bash's extglob matching > > will not perform suitably for this task, we can look at other approaches. > > Here's another: > > printf -- '%s ' $(gcc --help) | sed 's/ $/\n/'

Re: Parameter expansion with extended pattern make system hang

2022-09-06 Thread Martin Schulte
Hi! > > Here's another: > > > > printf -- '%s ' $(gcc --help) | sed 's/ $/\n/' > > > > Let just do the shell most of the work ;-) > > That's not safe. The unquoted substitution will undergo word splitting, > which we want, and also globbing, which we do *not* want. > > You should at least

Re: Parameter expansion with extended pattern make system hang

2022-09-06 Thread Chet Ramey
On 9/4/22 10:48 PM, Hyunho Cho wrote: Bash Version: 5.1 Patch Level: 16 Release Status: release ## "gcc --help" is already a short string, but the system hangs. ( without using extended pattern, there is no such problem )

Re: Found Bug and generated report using Bashbug

2022-09-06 Thread Dale R. Worley
Chet Ramey writes: > On 9/5/22 6:13 PM, Aryan Bansal wrote: > >While testing how bash handles foreground and background processes > >using "&", I found out that the behaviour is sometimes undefined. The > >prompt sometimes prints just as the background process finishes executing >

Re: test or [ does not handle parentheses as stated in manpage

2022-09-06 Thread Julian Gilbey
On Mon, Sep 05, 2022 at 11:04:41PM -0400, Dale R. Worley wrote: > Julian Gilbey writes: > > Upgrading to bash 5.2.0(1)-rc2 did not help, neither did using \( > > instead of (, and neither did putting spaces around the parentheses. > > It's ugly. The first point is that ( and ) are special

Re: test or [ does not handle parentheses as stated in manpage

2022-09-06 Thread Julian Gilbey
On Tue, Sep 06, 2022 at 09:25:36AM -0400, Chet Ramey wrote: > On 9/6/22 1:51 AM, Julian Gilbey wrote: > > On Tue, Sep 06, 2022 at 12:03:20AM +0200, Andreas Schwab wrote: > > > On Sep 05 2022, Julian Gilbey wrote: > > > > > > > neither did using \( > > > > instead of (, and neither did putting

Re: test or [ does not handle parentheses as stated in manpage

2022-09-06 Thread Julian Gilbey
On Tue, Sep 06, 2022 at 02:56:12PM +0100, Julian Gilbey wrote: > > > Ah, thanks! May I suggest that adding this information as a note in > > > the manpage would be very helpful? > > > > The man page says, in the `test' description: > > > > "Each operator and operand must be a separate

Re: test or [ does not handle parentheses as stated in manpage

2022-09-06 Thread Chet Ramey
On 9/6/22 1:51 AM, Julian Gilbey wrote: On Tue, Sep 06, 2022 at 12:03:20AM +0200, Andreas Schwab wrote: On Sep 05 2022, Julian Gilbey wrote: neither did using \( instead of (, and neither did putting spaces around the parentheses. You need to do both. Ah, thanks! May I suggest that

Re: test or [ does not handle parentheses as stated in manpage

2022-09-06 Thread Chet Ramey
On 9/6/22 9:57 AM, Julian Gilbey wrote: On Tue, Sep 06, 2022 at 02:56:12PM +0100, Julian Gilbey wrote: Ah, thanks! May I suggest that adding this information as a note in the manpage would be very helpful? The man page says, in the `test' description: "Each operator and operand must be a

Re: [PATCH] Calling `trap xxx INT' in completion functions of `complete -F' leaves readline in a strange state

2022-09-06 Thread Chet Ramey
On 9/2/22 6:28 AM, Koichi Murase wrote: Bash Version: 5.1 Patch Level: 16 Release Status: release Description: In Bash versions from 4.3 to the current devel, after calling `trap' for SIGINT in completion functions specified to `complete -F', readline is left in a strange state where

Re: Found Bug and generated report using Bashbug

2022-09-06 Thread Chet Ramey
On 9/5/22 6:13 PM, Aryan Bansal wrote: >Bash Version: 5.1 >Patch Level: 16 >Release Status: release > >Description: > While testing how bash handles foreground and background processes >using "&", I found out that the behaviour is sometimes undefined. The >prompt sometimes prints just as the

Re: Parameter expansion with extended pattern make system hang

2022-09-06 Thread Chet Ramey
On 9/4/22 10:48 PM, Hyunho Cho wrote: Bash Version: 5.1 Patch Level: 16 Release Status: release ## "gcc --help" is already a short string, but the system hangs. A short string? It's 90K on my system. ( without using