Attck of teh AzN Cow flu! (cowbert) wrote in unixadmin,
Attck of teh AzN Cow flu!
cowbert
unixadmin

escaping colons in filenames

I have this weird problem where no matter how I try to escape the colon in a file name, I cannot get rsync or scp to copy it, because it parses the colon and thinks that the string preceding the colon in the filename is a hostname (and complains that it cannot to remote to remote transfers, which is, uh, sort of common sense :)

So far, I've been working around this by sticking the files that have colons in them in a folder and them using -r to copy the contents of that folder, but I feel so ashamed having to resort to that (worse than the unnecessary use of cat(1)).

Edit: Here is the specific problem I am having:

% scp myfile\:foo somehost:/somedir/
error: unknown host myfile
scp "myfile:foo" somehost:/somedir/
error: unknown host myfile
% rsync "myfile:foo" somehost:/somedir/
error: cannot transfer files between remote hosts
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

  • 5 comments