You are not logged in.

#1 2008-01-31 19:30:49

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,896
Website

bash spaces?

Hi,

I have got a backup script I am working on

The directory path is /media/Backup Drive now rsync does not like the space in directory name

Added ' to it

/media/'Backup Drive'/

seems to work but wanted to know if its the best way to do it?

MrG


Mr Green

Offline

#2 2008-01-31 19:33:38

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: bash spaces?

You can also escape the space like so:

/media/Backup\ Drive/

The backslash-space is important

Offline

#3 2008-01-31 19:36:59

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: bash spaces?

You could probably also just quote the whole thing:
'/media/Backup Drive/'

Offline

#4 2008-01-31 20:20:17

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,896
Website

Re: bash spaces?

emm tried backslash but rsync did not like it... will try again :-)

quote whole ... emm looks cleaner thanks


Mr Green

Offline

#5 2008-01-31 22:27:10

Gilneas
Member
From: Netherlands
Registered: 2006-10-22
Posts: 320

Re: bash spaces?

or ?, or * (/med*/Bac*/)

Offline

#6 2008-02-01 05:50:49

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,896
Website

Re: bash spaces?

media is not the problem its the Backup Drive the space will try '*' and look up ? :-)


Mr Green

Offline

Board footer

Powered by FluxBB