What does this bash line do?

Eric Blake eblake@redhat.com
Fri Feb 26 13:53:00 GMT 2010


According to Tim Visher on 2/26/2010 6:46 AM:
> Hi All,
> 
> I'm working on my bashrc and I found [this
> line](http://pastie.org/844068)

Pasting 3 lines to pastebin was a waste; just inline them in your email:

case $- in
  *i*) [[ -f /etc/bash_completion ]] && . /etc/bash_completion ;;
esac

> My question then, is what exactly is this line doing?

It is seeing if you have bash-completion installed, and if so, loading it,
so that your tab-completion is more powerful.  The check for an i within
$- is to make sure your shell is interactive, as it is a waste to start
bash-completion in a non-interactive shell.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 320 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100226/1d7038ca/attachment.sig>


More information about the Cygwin mailing list