>> 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.

So, really, all that's needed is:

shopt -q extglob || extoff=Y
shopt -s extglob
# Do stuff here
[ "$extoff" ] && shopt -u extglob

=================================================================================
Please do not send me replies to my posts on the list.
I always read the replies via the web archive, so CC'ing to me is unnecessary.

When responding to my posts, please try to refrain from giving bureaucratic 
answers.
If you have nothing useful to say, then just click Next and go on.

  • 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