This is the mail archive of the
cygwin
mailing list for the Cygwin project.
bash and variable holding directories with spaces
- From: "H.S." <hs dot samix at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Sat, 03 Dec 2005 17:19:39 -0500
- Subject: bash and variable holding directories with spaces
Hi,
I am writing up a rsync script to back up a Windows box using cygwin
running on it. On my Debian Testing, which will do the backups, I plan
to run a cron job.
In the script, I am faced with this problem of defining the source
directories (dirs on the remote machine to be backed up) in a bash
variable. I want to define a variable DIRS so that it expands to:
'/cygdrive/c/Documents\ and\ Settings /cygdrive/d/My\ Data'
*with* the quotes, to copy "/cygdrive/c/Documents and Settings" and
"/cygdrive/d/My Data" to my local machine. I want to use this variable
in the rsync command, like so:
rsync -av remotehost:$DIRS /mnt/backups
I have tried a few ways to define the DIRS variable, but I am able to
get quotes in the expanded value of the variable.
Can anyone help in this?
->HS
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/