Find the answer to your Linux question:
Results 1 to 3 of 3
I'm running Cygwin. Here is what I'm trying to sync: The path is /cygdrive/c/Program Files (x86) I'm going to leave out the /cygdrive/c for brevity. rsync -avz john@doe.com :/Program\ Files\ ...
  1. #1
    Just Joined!
    Join Date
    Jul 2004
    Location
    Florida
    Posts
    6

    Cannot escape parenthesis using rsync

    I'm running Cygwin.
    Here is what I'm trying to sync:

    The path is /cygdrive/c/Program Files (x86)
    I'm going to leave out the /cygdrive/c for brevity.

    rsync -avz john@doe.com:/Program\ Files\ \(x86\) ./

    I've also tried:
    rsync -avz john@doe.com:"/Program Files (x86)" ./

    and:
    rsync -avz john@doe.com:/Program\ Files\ \\(x86\\) ./

    I get this error for the first two:
    line 2: syntax error near unexpected token `('
    and the third one tells me the same thing except ')' is the unexpected token.

    Any ideas as to what I'm doing wrong?

    Thanks,

    Alex C.

  2. #2
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    So I am going to assume that these errors are all coming from rsync, and not from Bash.

    In any event, you have escaped the parens in Bash. If rsync is complaining about them, you need to escape them there too:
    Code:
    rsync -avz john@doe.com:"/Program Files \\(x86\\)" ./
    Now the quotes escape the parens for Bash, and the "\\"s (which will be turned into "\" by Bash) will escape the parens for rsync.
    DISTRO=Arch
    Registered Linux User #388732

  3. #3
    Just Joined!
    Join Date
    Jul 2004
    Location
    Florida
    Posts
    6
    Thank You Cabhan!!!
    Worked like a charm : )
    This drove me nuts for two hours...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...