${par@P} can cause segmentation faults

2021-08-28 Thread Emanuele Torre
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/bin' -DSTANDARD_UTILS_PATH='/usr/bin' -DSYS_BASHRC='/etc/bash

Handling options with optional arguments with getopts

2021-08-28 Thread hancooper
‐‐‐ Original Message ‐‐‐ On Friday, August 27, 2021 8:52 PM, Robert Elz wrote: > Date:Fri, 27 Aug 2021 17:20:39 + > From:nigelberlinguer > > Message-ID: > > > > | It should be noted though, that the POSIX requirement by "Guideline 7" > | is not guided b

Re: ${par@P} can cause segmentation faults

2021-08-28 Thread Chet Ramey
On 8/28/21 4:07 AM, Emanuele Torre wrote: Bash Version: 5.1 Patch Level: 8 Release Status: release Description: PS1=\${PS1@P} makes bash segfault in interactive shells. a=\${a@P};${a@P} makes bash segfault also in non-interactive shells. Yes. If you set up and execute an i

Re: Handling options with optional arguments with getopts

2021-08-28 Thread Robert Elz
Date:Sat, 28 Aug 2021 15:26:28 + From:hancooper Message-ID: | Would the code break if I use shortopts="Vuhv:s" (allows getopts | to issue errors, not in silent mode) but also have the (":") and | ("?") checks inside the case statement? Not break, but the

Handling options with optional arguments with getopts

2021-08-28 Thread hancooper
‐‐‐ Original Message ‐‐‐ On Saturday, August 28, 2021 4:49 PM, Robert Elz wrote: > Date:Sat, 28 Aug 2021 15:26:28 + > From:hancooper > > Message-ID: > > > > | Would the code break if I use shortopts="Vuhv:s" (allows getopts > | to issue errors, not in s