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 dis

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 ) bash$

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! > 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 str

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 extended

Parameter expansion with extended pattern make system hang

2022-09-04 Thread Hyunho Cho
Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall uname output: Linux EliteBook 5.15.0-43-generic #46-Ubuntu SMP Tue Jul 12 10:30:17 UTC 2022 x86_64 x86_64