bug-bash
[Top][All Lists]
Advanced

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

Re: Parameter expansion with extended pattern make system hang


From: Chet Ramey
Subject: Re: Parameter expansion with extended pattern make system hang
Date: Tue, 6 Sep 2022 16:34:00 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.1

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$ help=$( gcc --help )

bash$ echo "${help//+([$' \t\n'])/ }"

If you want the output in a single string, this is a two-liner with sed and
mapfile, and it runs the 90K output of gcc --help in about a tenth of a
second on my machine.

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




reply via email to

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