delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/03/20/17:46:40

From: Jason Green <news AT jgreen4 DOT fsnet DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Tab completion in BASH 2.04
Date: Tue, 20 Mar 2001 22:37:36 +0000
Lines: 69
Message-ID: <g1lfbtkjfn9o09pfnuf6rdpii7ou2n7v4u@4ax.com>
References: <q1dabt4l7ec0a0jted3rpvt56ch0g34ebg AT 4ax DOT com> <Pine DOT SUN DOT 3 DOT 91 DOT 1010319093757 DOT 21558J-100000 AT is>
NNTP-Posting-Host: modem-87.neon.dialup.pol.co.uk
Mime-Version: 1.0
X-Trace: news8.svr.pol.co.uk 985127811 14127 62.136.9.87 (20 Mar 2001 22:36:51 GMT)
NNTP-Posting-Date: 20 Mar 2001 22:36:51 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Forte Agent 1.7/32.534
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:

> I'm not sure the colon needs to be escaped (why?)

I don't know, but Bash seems to want it (something to do with using
':' to seperate paths perhaps ??)

This is from Linux:

bash-2.03$ mkdir -p "c:/foo bar"
bash-2.03$ rmdir -p c:/foo
 press TAB - nothing happens, so complete the line manually
bash-2.03$ rmdir -p c:/foo\ bar
bash-2.03$ 

Now try with the colon escaped:

bash-2.03$ mkdir -p "c:/foo bar"
bash-2.03$ rmdir -p c\:/foo
 press TAB
bash-2.03$ rmdir -p c\:/foo\ bar/
bash-2.03$ 

Escaping the colon helps Bash to complete the path.  Somehow this
happens automagically in the DJGPP port of Bash 2.03, and this feature
appears to be missing from the port of 2.04.

> Also, perhaps Bash should support completion when the file name is
> quoted, like this:
> 
> 
>   bash-2.04$ rmdir "c:/foo TAB

It does:

bash-2.03$ mkdir "c:/foo bar"
bash-2.03$ rmdir "c:/foo
 press TAB
bash-2.03$ rmdir "c:/foo bar"/
bash-2.03$ 

bash-2.04$ mkdir "c:/foo bar"
bash-2.04$ rmdir "c:/foo
 press TAB
bash-2.04$ rmdir "c:/foo bar/
 complete the last quote manually
bash-2.04$ rmdir "c:/foo bar/"
bash-2.04$

> Right now, I need to type this:
> 
>   bash-2.04$ rmdir "c:/foo" TAB
> 
> (note the closing quote) to get Bash 2.04 DTRT, but it then removes
> the quotes after the completion :-(.

What version?

bash-2.04$ bash --version
GNU bash, version 2.04.7(1)-release (i386-pc-msdosdjgpp)
Copyright 1999 Free Software Foundation, Inc.

> I guess this is one more reason not to use spaces in file names ;-)

And spaces in filenames are one good reason for the DJGPP port of Bash
to support them... ;-)

Note that these problems are only apparent when the path contains a
dos drive letter and colon, otherwise Bash 2.04 behaves as expected.

- Raw text -


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