X-Spam-Check-By: sourceware.org Message-ID: <18d205ed0703201921j6fc92afhf8b2f20b1bd1fab2@mail.gmail.com> Date: Tue, 20 Mar 2007 22:21:56 -0400 From: "Gregg Levine" To: cygwin AT cygwin DOT com Subject: Re: Tab Completion and Typical Behavior In-Reply-To: <20070321012856.GA21436@suncomp1.spk.agilent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070319222033 DOT GC12851 AT suncomp1 DOT spk DOT agilent DOT com> <22t0031r2jgupl1i8ugb2uqi6pc83i2mbv AT 4ax DOT com> <20070321012856 DOT GA21436 AT suncomp1 DOT spk DOT agilent DOT com> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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 3/20/07, Gary Johnson wrote: > On 2007-03-20, robert_neville310 AT yahoo DOT com wrote: > > On Mon, 19 Mar 2007 15:20:33 -0700, Gary Johnson > > wrote: > ^^^^^^^^^^^^^^^^^^^^^^^^ > Including someone's address in your reply is frowned upon in this > list. http://cygwin.com/acronyms/#PCYMTNQREAIYR > I personally don't care--it's too late for the address I use on > lists and I have a very good spam filter--but other folks are very > sensitive to the issue, and rightly so. > > I don't know what the list policy is for users who use only their > address and don't include their name in their "From: " header, but I > see that my mailer used your address because it couldn't find a > name. Oops. > > > > > >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. > > You're welcome. > > > Eric Blake wrote: > > > > 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. > > Interactive mode is the mode the shell is in when you're controlling > it from a command prompt. The shell is usually not in interactive > mode when it's executing a script. > > You can get the bash-completion package from here: > > http://cygwin.com/packages/ > > but I don't know if it installs the .bash_completion file itself or > whether you have to do that yourself. I didn't even know about it > until reading Eric's reply. > > > > > complete -c sh > > > > Do I need to place this statement in the .bashrc? What is the proper > > syntax? > > Unless you are going to use the bash-completion package which will > apparently get you this and much more, then yes, put that statement > just as it is in your ~/.bashrc. That's one of the nice things > about bash and other Unix shells: the syntax in a script file or > initialization file is the same as the syntax from the keyboard. > > > > > 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 $- ? > > $- is an environment variable that contains the current set of > options. For example, from the bash I have running in an rxvt > window, > > $ echo $- > himBH > > You can then execute "man bash" and search for -h, for example, to > discover that the shell will "[r]emember the location of commands as > they are looked up for execution. This is enabled by default." > > Regards, > Gary > > -- > Gary Johnson | Agilent Technologies > garyjohn AT spk DOT agilent DOT com | Mobile Broadband Division > | Spokane, Washington, USA > > -- > 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/ > > Hello! Actually Gary the web based mailer behind Yahoo is quite badly managed, so that will always happen, and unfortunately, Google Mail as much as I like it does that to. I deleted your address from the reply up there. However the filters for Google Mail are nearly as aggressive as the trainers at Fairchild AFB near you were supposed to have been. (I also have family living in your locality as it happens!) What he's up to is the typical game that gets played all over the place, either with Cygwin, or with Linux, or even probably HP/UX, you try everything. If it works which I doubt he'll learn something, if it does not which I do not, then he'll learn something. Other then that, then the blurb above is what I've contributed to this thread, the one below the greeting is the formality. -- Gregg C Levine gregg DOT drwho8 AT gmail DOT com "This signature was once found posting rude messages in English in the Moscow subway." -- 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/