X-Spam-Check-By: sourceware.org Message-ID: <8423703.post@talk.nabble.com> Date: Wed, 17 Jan 2007 17:50:26 -0800 (PST) From: Troy To: cygwin AT cygwin DOT com Subject: Space in Dir Name with shell script and tar MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: talexander AT veeco DOT com X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com I am trying to make a shell script to do automatic bckups with tar. My problem is that tar stumbles on the spaces in the dir names if they are in a variable. Probiably best shown by example The dir I want to back up is g:/Mark I+/Experimental Data/ I if do this in the script tar -czvpf $NAME_OF_BACKUP.tgz /cygdrive/g/Mark' 'I+/Experimental' 'Data/* it works fine but if I do this DIRECTORY_TO_BACKUP="/cygdrive/g/Mark' 'I+/Experimental' 'Data" tar -czvpf $NAME_OF_BACKUP.tgz $DIRECTORY_TO_BACKUP/* I get tar: Removing leading `/' from member names tar: /cygdrive/g/Mark': Cannot stat: No such file or directory tar: 'I+/Experimental': Cannot stat: No such file or directory tar: 'Data/*: Cannot stat: No such file or directory tar: Error exit delayed from previous errors What am I doing wrong? -- View this message in context: http://www.nabble.com/Space-in-Dir-Name-with-shell-script-and-tar-tf3031755.html#a8423703 Sent from the Cygwin Users mailing list archive at Nabble.com. -- 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/