-1

In my project I frequently need to copy the files/folders which got changed between 2 SVN revisions.

I am able to get the list of these changed files/folders using below command:

svn diff -r START REVISION:END REVISION --summarize

Now I would like to copy the list returned by the above command to a specific server location for further operations on it.

Currently I am executing the copy command like this:

cp --parents file1.php, file2.php, upload/upload.php

My question is: Is there any single Linux command which will perform above 2 mentioned operations? (Directly copy the files which were returned by the SVN diff command.)

I have tried the Pipes operator for performing chain commands.

svn diff -r START REVISION:END REVISION --summarize | cp --parents

But it doesn't work.

I am sure that there is a way to combine both the operation using one single command, but I am not sure how to do that.

Mahm00d
  • 3,881
  • 8
  • 44
  • 83
user2746557
  • 81
  • 1
  • 9
  • 1
    possible duplicate of [pass output as an argument for cp in bash](http://stackoverflow.com/questions/6833582/pass-output-as-an-argument-for-cp-in-bash) – tripleee Sep 05 '15 at 12:25
  • Thanks tripleee. I got the solution from your suggested Link. The final command is cp --parents `svn diff -r 24:35 --summarize` ../testcp/ – user2746557 Sep 07 '15 at 08:03

1 Answers1

0

The following is the answer of my question. As I have used substitute operator which make sure that the output of the svn diff command pasted as a input for the CP command.

cp --parents `svn diff -r 24:35 --summarize` ../testcp/
user2746557
  • 81
  • 1
  • 9