Lasse Kliemann | 30 Oct 2008 17:46

-copy mode and patterns

One can use the following to copy all files matching pattern 
'*.txt' from the subtree rooted at 'src' to the subtree rooted at 
'dst':

   star -c -C src . | star -x -C dst pat="*.txt"

It is crucial that the 'pat=...' is placed _after_ the '-C ...'.

Now, the following will _not_ work in the same way:

   star -copy pat="*.txt" -C src . dst

It will place a file 'src/foo.txt' in the current directory 
instead of placing it into 'dst'. This seems to be the same 
result as when doing a modification of the first construction:

   star -c -C src . | star -x pat="*.txt" -C dst

My question: is there a way to invoke '-copy' mode such that it 
will have the same results as the first construction, where 
'pat=...' is placed after '-C'?

General comment: Having a compact form of expressing "copy all 
files matching pattern ..." would be nice. It's also not so easy 
when using Rsync. One has to do something like this:

   rsync -a --include "*.txt" --include "*/" --exclude "*" src/ dst

(Continue reading)


Gmane