delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/05/21/08:59:26

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <E08D1D96ABE2D2119B3300A0C94D23062B2FF5@hopper.logica.co.uk>
From: "Fieldhouse, Dirk" <Fieldhouse AT logica DOT com>
To: cygwin AT sourceware DOT cygnus DOT com
Subject: RE: Strangeness executing script with space in filename
Date: Fri, 21 May 1999 13:57:59 +0100
X-Mailer: Internet Mail Service (5.5.2448.0)

On Fri, 21 May 1999 04:54:37 -0700 (PDT), Earnie
Boyd[SMTP:earnie_boyd AT yahoo DOT com] wrote:
> --- Dirk Fieldhouse <fieldhouse AT logica DOT com> wrote:
> > B20.1, NT4W/SP3
> > 
> > Suppose I have files such as the following:
> > 
> > /tmp/foo.exe
> > /tmp/fum
> > /tmp/New Folder/foo.exe
> > /tmp/New Folder/fum
> > 
> > where fum is a shell script. In bash 2.02, suppose w,x,y,z are variables
set
> > to each of these filenames.
> > 
> > Then
> > 
bash> "$w"	# executes foo.exe

bash> "$x"	# executes fum script

bash> "$y"	# executes foo.exe

bash> "$z"	# loses: /tmp/New: not found

 (and incidentally z="/tmp/New\ Folder/fum" is no better) 

> > I'm not sure whether this is a bash/ash issue or more profound, eg
cygwin
> > exec().
> > Any ideas?
> 
> Uh, one place it's /tmp/New Folder/fum and the other place it's /test/New\

> Folder/fum.  Besides that, the FAQ or perhaps the README at the
cygwin/latest
> directory states that you'll have problems with _spaces_ within a path.
Yes
> quoting should be used with the space.

Thanks, Earnie, you spotted my half-hearted rework of the example. But
taking /tmp throughout as corrected above, the problem remains. The paths
_are_ quoted but different behaviour results for the same path depending on
whether the file is a .exe or a #!/script. Which falls somewhere between
weird and incorrect for me.

I'm guessing that executing the script results in an extra implicit
quote-stripping that doesn't happen with the .exe.

-- 
Dirk Fieldhouse                 Logica UK Limited
fieldhouse AT logica DOT com           75 Hampstead Road
c=gb;a=attmail;p=logica;        London NW1 2PL
o=LOGICA;ou1=UK;s=fieldhouse    UK
+44 (171) 637 9111


Not speaking for Logica



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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