How to make surround svn mv on Unix

I want the array to move a large number of files from one directory to another in svn. Unfortunately, svn only supports moving one file at a time.

Basically I want to move files of a certain type (.xml) to a completely different directory, for example. mv foo / bar / .xml forbar / xml

I tried playing with find and using -exec, but I need to disable the directory for the second argument. Any ideas?

EDIT: using bash

+3
source share
2 answers

You can do this with the option -execdir. This is done from the directory where the source files are located (which avoids race conditions with directory bindings, etc.).

find -name '*.xml' -execdir svn move {} `pwd`/foobar/{} \;
+5
source

, bash:

for x in `find -name *.xml`; do
   echo svn move $x forbar/`basename $x`;
done

, , "" .

+5

Source: https://habr.com/ru/post/1703729/


All Articles