Filenames with blanks

tim.conway at philips.com tim.conway at philips.com
Fri Aug 23 13:34:01 EST 2002


The output of the file list is treated as a list.  The easiest solution 
would be to iterate through the list.
Now, you understand that as you have constructed this, you create a 
commandline in a variable.  In the "$COM" you are executing that 
commandline, and putting its contents as a part of the $src_host: token. 
The find is NOT being executed on the remote, so what you are doing is 
asking the remote for its copy of each file you have a file in $src_dir 
that is less than $days old.  Is that actually what you want?

A better solution to the spaces problem is
++++++++++++++++++++++++++++++++++++++++++++++++++++++
find $srcdir -print |
grep ' ' |
while read item
  do
    mv $item `echo $item |tr ' ' _`
  done
++++++++++++++++++++++++++++++++++++++++++++++++++++++

Yeah, I know you CAN have spaces in filenames, but it's such a pain in the 
ass, just to satisfy some luser who wants to use them.

Tim Conway
tim.conway at philips.com
303.682.4917 office, 303.921.0301 cell
Philips Semiconductor - Longmont TC
1880 Industrial Circle, Suite D
Longmont, CO 80501
Available via SameTime Connect within Philips, caesupport2 on AIM
"There are some who call me.... Tim?"




Ivan Kovalev <ivan at wssource.com>
Sent by: rsync-admin at lists.samba.org
08/23/2002 04:09 PM

 
        To:     rsync at lists.samba.org
        cc:     (bcc: Tim Conway/LMT/SC/PHILIPS)
        Subject:        Filenames with blanks
        Classification: 



Command like this:
    rsync  -rxlupogtSvve ssh
$src_host:"/home/wss_disk/calendar.data/'Conference Calls'" $targ_dir
works fine with blanks embeded in the file name.
When I try to script it like this:
    COM='`find '$src_dir'  -mtime -'$days' -type f `'
    rsync  -rxlupogtSvve ssh  $src_host:"$COM" $targ_dir
works fine on regular filenames, but does not see the ones with blanks
in the middle.

I changed my COM to pipe through little script to produce the same
output where either the whole filepath or just the file name will be
quoted (as in the first example). That breakes it complitely and this
version does not work even for single word files. Output looks like
this:
.......................
receiving file list ...
link_stat /home/wss_disk/calendar.data/'Conference : No such file or
directory
link_stat Calls' : No such file or directory
link_stat /home/wss_disk/calendar.data/'Economic' : No such file or
directory

I probably am missing something simple, but could not figure what is it.
Please advise. Thank you.
--
Ivan Kovalev
Wall Street Source
120 Broadway, 27-th floor
New York, NY 10271
Pager: ikovalev at skytel.com, (888)688-5202
Phone: (212)479-1445
E-mail: ivan at wssource.com


-- 
To unsubscribe or change options: 
http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html






More information about the rsync mailing list