Re: du

[prev] [thread] [next] [lurker] [Date index for 2005/10/04]

From: Phil!Gregory
Subject: Re: du
Date: 14:50 on 04 Oct 2005
* Luke Kanies <luke@xxxxxxx.xxx> [2005-09-30 13:36 -0500]:
> I use '.' all the time, though, and would often be quite lost without it
> (although it could be argued that most of those problems stem from
> stupid or unclear tools).  For instance:
> 
>     rsync -a /somedir/. /otherdir/.

rsync is quite deserving of some hate for its ... interesting syntax
choices.  I often have to check the man page (which, annoyingly, lists the
usage examples *before* the option descriotions) to recall which way it
goes.  The key item is whether you put a slash at the end of your source
directory.

Let's say you have /a, /a/b, /a/c, and /x.  This:

  rsync /a /x

will create directories /x/a, /x/a/b, and /x/a/c.  On the other hand,
this:

  rsync /a/ /x

will create directories /x/b and /x/c.

Presumably, this is to get around the problem where you want to copy all
of the contents of a remote directory, but you can't use globbing, because
that's expanded locally, by the shell.

Given the whole globbing issue, I happen to think that scp's approach is
less hateful; if you pass it globbing characters (quoting them to protect
them from your shell), it uses a shell on the other system to expand them
remotely.  (But, of course, that will probably miss dot files unless you
specify them explicitly.)

-- 
...computer contrarian of the first order... / http://aperiodic.net/phil/
PGP: 026A27F2  print: D200 5BDB FC4B B24A 9248  9F7A 4322 2D22 026A 27F2
--- --
<PyroP> Let's ask someone with a slightly more intelligent opinion. Hello,
        wall, what do you think?
                       -- seen on #megazeux
---- --- --
There's stuff above here

Generated at 16:00 on 04 Oct 2005 by mariachi 0.52