This is the mail archive of the
mailing list for the Cygwin project.
Re: cygpath -u doesn't seem to convert spaces properly
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin at cygwin dot com
- Date: Tue, 25 Sep 2007 17:39:24 -0700
- Subject: Re: cygpath -u doesn't seem to convert spaces properly
- References: <email@example.com> <firstname.lastname@example.org>
- Reply-to: cygwin at cygwin dot com
Jerome Fong wrote:
> $ cd $ttt
> bash: cd: /cygdrive/c/Program: No such file or directory
Yes, that's wrong. But more importantly, it's not wrong just in the
POSIX/Win32 path sense, it's wrong in the sense that it can't cope with
any argument that contains whitespace. Your script would also fail on a
Linux system that for example had a directory like "~/some files" -- and
in that case there is no 8.3 short filename hack to save you, so there
is no avoiding the need for proper quoting. It's got nothing to do with
cygpath and everything to do with proper portable scripting practice.
> Is is possible to setup the variable to not require the double quotes?
Only if you neglect to support filenames and paths with spaces in them.
> Since my other method doesn't require the double quotes, it would
> make the scripting much easier. I wouldn't need to keep track of which
> variables I had to double quote.
Easier perhaps but still broken.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html