4MACS-Will

Q: serious terminal bug

I have verified this bug only one one computer, but that one computer was freshly formatted, installed 10.10.3 directly, and the problem happens two ways:

 

rsync -avz /Shared\ Items/ root@remote.computer:/Volumes/Promise\ Pegasus/

 

Actually places a folder in the Volumes directory called Promise, and the command proceeds to fill up the boot volume with the contents of Shared Items from the old server.

 

Running the command as rsync -avz /Shared\ Items/ "root@remote.computer:/Volumes/Promise Pegasus/"

 

has the same bug. And to make it worse, it is random. The first try without the quotes failed. The second try with the quotes worked. The third try, with quotes, and as a final pass of rsync, also failed.

 

I cannot report this in bug reporter because for some reason it will not let either of my apple ID's to log in.

iMac, OS X Yosemite (10.10.1)

Posted on May 4, 2015 11:31 AM

Close

Q: serious terminal bug

  • All replies
  • Helpful answers

  • by Linc Davis,

    Linc Davis Linc Davis May 4, 2015 12:15 PM in response to 4MACS-Will
    Level 10 (208,000 points)
    Applications
    May 4, 2015 12:15 PM in response to 4MACS-Will

    Not a bug. Best to avoid spaces in file names when using the shell.

     

    rsync -avz /Shared\ Items/ root@remote.computer:/Volumes/Promise\\\ Pegasus/

  • by 4MACS-Will,

    4MACS-Will 4MACS-Will May 4, 2015 12:58 PM in response to 4MACS-Will
    Level 1 (0 points)
    May 4, 2015 12:58 PM in response to 4MACS-Will

    It may be "best to avoid" I but it's perfectly acceptable to do this. That's why you can escape the space in the command.

     

    And the alternative is to include the command in quotes, which also fails randomly.

     

    I'm not convinched your answer is correct. 

  • by Linc Davis,

    Linc Davis Linc Davis May 4, 2015 1:07 PM in response to 4MACS-Will
    Level 10 (208,000 points)
    Applications
    May 4, 2015 1:07 PM in response to 4MACS-Will

    I'm not convinched your answer is correct.

    So you're not going to try it?

  • by 4MACS-Will,

    4MACS-Will 4MACS-Will May 4, 2015 1:41 PM in response to Linc Davis
    Level 1 (0 points)
    May 4, 2015 1:41 PM in response to Linc Davis

    That is a very strong statement.

     

    I've been support Mac OS in small enterprise networks for longer than OS X has been a product. According to OS X: Cross-platform filename best practices and conventions - Apple Support "OS X and Mac OS formatted disks support spaces in filenames"

     

    I've performed this exact command in hundreds of instances. Maybe thousands. And I've never seen a command fail when it's encapsulated in quotes. I've seen it fail without the quotes (not very often, though), which is why I quoted it.

     

    But having it pass one time in quotes and fail the next time - the SAME EXACT COMMAND, by scrolling up in the history, is what concerned me.

     

    If this is a new feature of 10.10.3, so be it, I'll remove the space. But that does not explain why the command worked one time and not the next.

  • by iW00,

    iW00 iW00 May 4, 2015 2:10 PM in response to 4MACS-Will
    Level 4 (1,349 points)
    May 4, 2015 2:10 PM in response to 4MACS-Will

    4MACS-Will wrote:

     

    If this is a new feature of 10.10.3, so be it, I'll remove the space. But that does not explain why the command worked one time and not the next.

    This has nothing to do with 10.10.3. It is a bash interpretation and the same command will have the same result on any UNIX based system where bash is used.

     

    Try this:

    rsync -avz /Shared\ Items/ root@remote.computer:'/Volumes/Promise\ Pegasus/'

     

    Use singel quotes instead of doubles.

     

    For more info, type in terminal:

    man bash


  • by cdhw,

    cdhw cdhw May 4, 2015 3:30 PM in response to 4MACS-Will
    Level 4 (2,668 points)
    Servers Enterprise
    May 4, 2015 3:30 PM in response to 4MACS-Will

    The argument describing the target needs to survive being stripped twice, once by the local bash and once at the target. Linc Davis's suggestion is one method, and:

     

         rsync -avz /Shared\ Items/ "root@remote.computer:/Volumes/Promise\ Pegasus/"

     

    , which I find more readable, should work too. This is discussed in the 'ADVANCED USAGE' section of the man page.

     

    OS X 10.10.3 comes with rsync 2.6.9 (ca 2006) I don't know why Apple has doggedly stuck with this particular version. If you want a more recent version you'll need to  build it from source:


         https://rsync.samba.org


    or use MacPorts if you are looking for something a little less hardcore.


    C.