delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/03/20/18:56:05

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: robert_neville310 AT yahoo DOT com
Subject: Re: Tab Completion and Typical Behavior
Date: Tue, 20 Mar 2007 16:55:05 -0700
Lines: 50
Message-ID: <22t0031r2jgupl1i8ugb2uqi6pc83i2mbv@4ax.com>
References: <f8utv294jjjninbskuj5csfh2kq0hag8d6 AT 4ax DOT com> <20070319222033 DOT GC12851 AT suncomp1 DOT spk DOT agilent DOT com>
Mime-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Mon, 19 Mar 2007 15:20:33 -0700, Gary Johnson
<garyjohn AT spk DOT agilent DOT com> wrote:

>On 2007-03-19, robert_neville310 AT yahoo DOT com wrote:
>> I have a question about tab completion in the console window. The
>> .bash_profile exports the right paths and the console performs tab
>> completion. My scripts can be found in ~/bin. I can tab out
>> myscript.sh, but can not tab complete ./myscript.sh; or sh
>> myscript.sh. Is this behavior normal? Can I change the console
>> behavior to tab out ./myscript.sh?
>
>Larry didn't address the case of
>
>    sh myscript.sh
>
>which doesn't seem to work by default.  However, you can tell bash 
>to expand the arguments to sh as commands by executing
>
>    complete -c sh
>
Works great. Thanks Gary.


> That is, if you don't use the bash-completion package.  If you install
> that, and tweak your ~/.bashrc (/etc/defaults/etc/skel/.bashrc has some
> hints), then you get this, and many other, programmable completion tweaks
> by default.

Not many hints in my .bashrc. It just has this code block.

# If this shell is interactive, turn on programmable completion
enhancements.
# Any completions you add in ~/.bash_completion are sourced last.
# case $- in
#   *i*) [[ -f /etc/bash_completion ]] && . /etc/bash_completion ;;
# esac

 I am not familar with  interactive mode and do not have a
bash_completion file.

complete -c sh

Do I need to place this statement in the .bashrc? What is the proper
syntax?

I am asking for confirmation to avoid breaking my console. By the way,
I do not have the bash_completion file or a template for it. I could
easily touch the file if necessary.

What is $- ?


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019