Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Message-Id: <5.2.0.9.0.20030227151820.073b9ec8@mail.real.com> X-Sender: csiemens AT mail DOT real DOT com Date: Thu, 27 Feb 2003 15:19:09 -0800 To: cygwin AT cygwin DOT com From: Curtis Siemens Subject: bash's (built-in) type command can not handle spaces in paths Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed My platform is Windows 2000 (with all the latest patches). This problem probably occurs on a number of Windows platforms. I'm using the latest released Cygwin with Cygwin DLL release version 1.3.20-1 I've searched the Web/Faq/Documentation/Mailing-Lists and haven't seen any reference to this problem. Cygwin's type command (built into bash.exe) does not work for executables that are under a directory that has spaces. I.e. if the file c:\program files\prog.exe exists then running any of these does not work (and "/cygdrive/c/dir xy" is in your PATH): type "/cygdrive/c/dir xy/prog.exe" type /cygdrive/c/dir\ xy/prog.exe type prog.exe The type command just returns nothing. Likewise this doesn't work: $ cd /cygdrive/c/dir\ xy $ type ./prog.exe The above doesn't work because prog.exe full path contains a space in one of the directories in its path. An offshoot of this problem, which really makes things bad is if your Cygwin is installed under a directory that contains spaces (and you don't mount the standard cygwin directories elsewhere, you just proceed with the typical default installation), and then you use the type command on any of the commands that exist under Cygwin mounts, the type command again does not work - which is a lot of basic utility programs that can't be "found" by using the type command. I.e. if you install Cygwin & all its utilities in the default manner under something like: c:\Program Files\cygwin or c:\cyg win Then running any of these will not work: type grep type /bin/grep type cat.exe etc. -> you get the idea. Its OK to have spaces in the executable filename itself, but all directories from the drive to that executable can not have spaces in their names. Even trying things like "type c:\progra~1\prog.exe" does not work around the issue. How To Reproduce: ----------------------------------------------------- Install Cygwin under c:\ or c:\cygwin - some directory that doesn't contain spaces & go with the typical/default installation. Once installed, put "/cygdrive/c/program files" & "/cygdrive/c/temp" in your PATH and run: type "/cygdrive/c/program files/prog.exe" /* Where prog.exe is some executable that EXISTS. */ => The command doesn't work - it can't find it, returning a blank, but doing: ls -ltrF "/cygdrive/c/program files/prog.exe" does work. Now run: type "/cygdrive/c/temp/prog.exe" /* Where prog.exe is some executable that EXISTS under c:\temp. */ See how it works on these types of paths that contain no spaces in their directories. ----------------------------------------------------- Curtis Siemens -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/