So "... || true" is here required when "set -e".  
  
It was also in the manual page, but I didn't figure that '-p' is a listing 
option :
  
```  
The return status when listing options is zero if all optnames are enabled, 
non-zero otherwise. When setting or unsetting options, the return status is 
zero unless an optname is not a valid shell option.  
```  
cf. <https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html>
  
Thanks a lot. 

++

```
-- 
```
#### Jean-Jacques Brucker

Certificat : 
[udid4=sRyUhe...](http://keys.foopgp.org:11371/pks/lookup?op=vindex&search=0xFE1349E747CF1896)


-------- Message initial --------  
**De**: Andreas Schwab 
<[[email protected]](mailto:andreas%20schwab%20%[email protected]%3e)>  
**À**: Jean-Jacques Brucker 
<[[email protected]](mailto:jean-jacques%20brucker%20%[email protected]%3e)>  
**Cc**: [[email protected]](mailto:[email protected])  
**Objet**: Re: why "shopt -p" sometime return non-zero ?  
**Date**: 24/09/2025 14:28:18

On Sep 24 2025, Jean-Jacques Brucker wrote:


> But the line
> extglob="$(shopt -p extglob)" )
> returns 1.
> 
> Why ?


$ help shopt  
...  
    Exit Status:  
    Returns success if OPTNAME is enabled; fails if an invalid option is  
    given or OPTNAME is disabled.

Attachment: signature.asc
Description: This is a digitally signed message part

  • Re: wh... Stan Marsh
    • w... Jean-Jacques Brucker
      • ... Chris Elvidge
        • ... Chris Elvidge
      • ... Duncan Roe via Bug reports for the GNU Bourne Again SHell
        • ... Martin D Kealey
          • ... Jean-Jacques Brucker via Bug reports for the GNU Bourne Again SHell
      • ... Andreas Schwab
        • ... Jean-Jacques Brucker
    • R... Stan Marsh
      • ... Greg Wooledge

Reply via email to