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 x86_64 GNU/Linux Machine Type: x86_64-pc-linux-gnu
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'])/ }" #### It barely works for very short strings only. (so almost can not use) bash$ help=$( gcc --help | sed -n '1, 10p' ) bash$ echo "${help//+([$' \t\n'])/ }" Usage: gcc [options] file... Options: -pass-exit-codes Exit with highest error code from a phase. --help Display this information. --target-help Display target specific command line options. --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...]. Display specific types of command line options. (Use '-v --help' to display command line options of sub-processes). --version Display compiler version information. -dumpspecs Display all of the built in spec strings.