This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Strangeness executing script with space in filename


On Fri, 21 May 1999 04:54:37 -0700 (PDT), Earnie
Boyd[SMTP:earnie_boyd@yahoo.com] wrote:
> --- Dirk Fieldhouse <fieldhouse@logica.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@logica.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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]