Spaces in Paths

Jean-Sebastien Trottier jst1@email.com
Mon Mar 28 21:16:00 GMT 2005


On Mon, Mar 28, 2005 at 05:15:07PM +0100, zzapper wrote:
> Hi,
> 
> Mysql has now moved under c:/program files/
> 
> My backup bash script will run correctly if I use the follwing syntax 
> 
> /cygdrive/c/program\ files/mysql/MySQL\ Server\ 4.1/bin/mysqldump.exe $params
> 
> However it doesn't work if I try to load the above into a variable
> 
> eg
> mysqldump='/cygdrive/c/program\ files/mysql/MySQL\ Server\ 4.1/bin/mysqldump.exe'
> 
> I get "/cygdrive/c/program\: No such file or directory..."
> 
> Is this just hard luck?

Have you tried the following:

    mysqldump="/cygdrive/c/program files/mysql/MySQL Server 4.1/bin/mysqldump.exe"
    "$mysqldump" $params

Without the double-quotes around the actual call, the variable gets
split at spaces such that only the part up to the first space is treated
as the command (/cygdrive/c/program\) and the rest as parameters

Cheers,
Sebastien
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050328/449ffed3/attachment.sig>


More information about the Cygwin mailing list