Re: Documentation Update

2014-12-12 Thread David J. Haines
On Fri, Dec 12, 2014 at 01:59:50PM -0700, Bob Proulx wrote:
> Dennis Williamson wrote:
> > Bob Proulx wrote:
> > > I see a lot of hits in the bash_completion add-on files.  Should we be
> > > looking at:
> > >
> > >   $ grep -r "shopt -s extglob" /etc/bash*
> > >   /etc/bash_completion.d/nmh:shopt -s extglob
> > >   /etc/bash_completion.d/libreoffice.sh:test $g -eq 0 && shopt -s
> > > extglob
> > >   /etc/bash_completion.d/mercurial:shopt -s extglob
> > >   /etc/bash_completion.d/subversion:# pattern matching enabled (use 'shopt
> > > -s extglob progcomp' to enable
> > >   /etc/bash_completion.d/subversion:shopt -s extglob
> >
> > Perhaps you should check for shopt -u extglob reversing those.
> 
> Good point.
> 
>   $ grep -r "shopt -. extglob" /etc/bash*
>   /etc/bash_completion.d/nmh:orig_opts=$(shopt -p extglob) 
>   /etc/bash_completion.d/nmh:shopt -s extglob
>   /etc/bash_completion.d/libreoffice.sh:shopt -q extglob && g=1
>   /etc/bash_completion.d/libreoffice.sh:test $g -eq 0 && shopt -s extglob
>   /etc/bash_completion.d/libreoffice.sh:  test $g -eq 0 && 
> shopt -u extglob
>   /etc/bash_completion.d/libreoffice.sh:test $g -eq 0 && shopt -u extglob
>   /etc/bash_completion.d/mercurial:shopt -s extglob
>   /etc/bash_completion.d/subversion:shopt -s extglob
> 
> Bob

A very good point, indeed. I run Arch, so I was surprised to hear that
any sort of customization by the packager would have taken place. I
built a quick systemd namespace container with a fresh base install, and
sure enough, there extglob was not set. Upon installation of
bash-completion, however, it was.

Thanks for the help!
-- 
David J. Haines
djhai...@gmx.com
0xAFB3D16D - F929 270F B7C3 78AE A741  434F A7C6 F264 AFB3 D16C



Re: Documentation Update

2014-12-12 Thread Bob Proulx
Dennis Williamson wrote:
> Bob Proulx wrote:
> > I see a lot of hits in the bash_completion add-on files.  Should we be
> > looking at:
> >
> >   $ grep -r "shopt -s extglob" /etc/bash*
> >   /etc/bash_completion.d/nmh:shopt -s extglob
> >   /etc/bash_completion.d/libreoffice.sh:test $g -eq 0 && shopt -s
> > extglob
> >   /etc/bash_completion.d/mercurial:shopt -s extglob
> >   /etc/bash_completion.d/subversion:# pattern matching enabled (use 'shopt
> > -s extglob progcomp' to enable
> >   /etc/bash_completion.d/subversion:shopt -s extglob
>
> Perhaps you should check for shopt -u extglob reversing those.

Good point.

  $ grep -r "shopt -. extglob" /etc/bash*
  /etc/bash_completion.d/nmh:orig_opts=$(shopt -p extglob) 
  /etc/bash_completion.d/nmh:shopt -s extglob
  /etc/bash_completion.d/libreoffice.sh:shopt -q extglob && g=1
  /etc/bash_completion.d/libreoffice.sh:test $g -eq 0 && shopt -s extglob
  /etc/bash_completion.d/libreoffice.sh:  test $g -eq 0 && 
shopt -u extglob
  /etc/bash_completion.d/libreoffice.sh:test $g -eq 0 && shopt -u extglob
  /etc/bash_completion.d/mercurial:shopt -s extglob
  /etc/bash_completion.d/subversion:shopt -s extglob

Bob



Re: Documentation Update

2014-12-12 Thread Chet Ramey
On 12/12/14, 9:59 AM, David J. Haines wrote:
> Hi all,
> 
> When started interactively, bash sets the extglob shopt; however, that
> fact seems to have been overlooked in the manpage. The behavior of bash
> itself is great, but in the context of the manpage, it appears
> erroneous, as it indicates that use of 'shopt' is necessary for extglob
> to be enabled.

This is a configure-time option, but unless your vendor changes it, it's
off by default.  It can also be changed in a startup file or another file
that gets sourced, like bash-completion.


> Likewise, hostcomplete seems to be disabled when bash is
> non-interactive, which behavior is also not documented.

This isn't the case in bash as it's distributed:

$ cat x31
shopt hostcomplete
$ ./bash ./x31
hostcompleteon
$ ./bash -c 'shopt hostcomplete'
hostcompleteon
$ ./bash --version
GNU bash, version 4.3.30(881)-maint (i386-apple-darwin12.2.0)
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/



Re: Documentation Update

2014-12-12 Thread Dennis Williamson
On Fri, Dec 12, 2014 at 12:32 PM, Bob Proulx  wrote:

> Greg Wooledge wrote:
> > David J. Haines wrote:
> > > When started interactively, bash sets the extglob shopt; however, that
> > > fact seems to have been overlooked in the manpage.
> >
> > This is a compile-time setting.  Your vendor probably turned this on.
> >
> > imadev:~$ bash-4.3
> > imadev:~$ shopt | grep extglob
> > extglob off
> > imadev:~$ exit
>
> Also some vendors place a lot of customization in /etc/profile,
> /etc/profile.d/*, /etc/bash_otherplaces sourced in the above.  It
> might be turned on by one of those.
>
> I see a lot of hits in the bash_completion add-on files.  Should we be
> looking at:
>
>   $ grep -r "shopt -s extglob" /etc/bash*
>   /etc/bash_completion.d/nmh:shopt -s extglob
>   /etc/bash_completion.d/libreoffice.sh:test $g -eq 0 && shopt -s
> extglob
>   /etc/bash_completion.d/mercurial:shopt -s extglob
>   /etc/bash_completion.d/subversion:# pattern matching enabled (use 'shopt
> -s extglob progcomp' to enable
>   /etc/bash_completion.d/subversion:shopt -s extglob
>
> Bob
>
>
Perhaps you should check for shopt -u extglob reversing those.

-- 
Visit serverfault.com to get your system administration questions answered.


Re: Documentation Update

2014-12-12 Thread Bob Proulx
Greg Wooledge wrote:
> David J. Haines wrote:
> > When started interactively, bash sets the extglob shopt; however, that
> > fact seems to have been overlooked in the manpage.
> 
> This is a compile-time setting.  Your vendor probably turned this on.
> 
> imadev:~$ bash-4.3
> imadev:~$ shopt | grep extglob
> extglob off
> imadev:~$ exit

Also some vendors place a lot of customization in /etc/profile,
/etc/profile.d/*, /etc/bash_otherplaces sourced in the above.  It
might be turned on by one of those.

I see a lot of hits in the bash_completion add-on files.  Should we be
looking at:

  $ grep -r "shopt -s extglob" /etc/bash*
  /etc/bash_completion.d/nmh:shopt -s extglob
  /etc/bash_completion.d/libreoffice.sh:test $g -eq 0 && shopt -s extglob
  /etc/bash_completion.d/mercurial:shopt -s extglob
  /etc/bash_completion.d/subversion:# pattern matching enabled (use 'shopt -s 
extglob progcomp' to enable
  /etc/bash_completion.d/subversion:shopt -s extglob

Bob



Re: Documentation Update

2014-12-12 Thread Greg Wooledge
On Fri, Dec 12, 2014 at 09:59:50AM -0500, David J. Haines wrote:
> When started interactively, bash sets the extglob shopt; however, that
> fact seems to have been overlooked in the manpage.

This is a compile-time setting.  Your vendor probably turned this on.

imadev:~$ bash-4.3
imadev:~$ shopt | grep extglob
extglob off
imadev:~$ exit



Documentation Update

2014-12-12 Thread David J. Haines
Hi all,

When started interactively, bash sets the extglob shopt; however, that
fact seems to have been overlooked in the manpage. The behavior of bash
itself is great, but in the context of the manpage, it appears
erroneous, as it indicates that use of 'shopt' is necessary for extglob
to be enabled.

Likewise, hostcomplete seems to be disabled when bash is
non-interactive, which behavior is also not documented.

Perhaps a couple of small edits are in order?

All tbe best,

-- 
David J. Haines
djhai...@gmx.com
0xAFB3D16D - F929 270F B7C3 78AE A741  434F A7C6 F264 AFB3 D16C