delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/12/03/17:31:24

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: "H.S." <hs DOT samix AT gmail DOT com>
Subject: bash and variable holding directories with spaces
Date: Sat, 03 Dec 2005 17:19:39 -0500
Lines: 21
Message-ID: <dmt5ls$cvc$2@sea.gmane.org>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051007 Debian/1.7.12-1
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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/

- Raw text -


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