i have an svn working copy which i executed the following command in

find ./source * -type f -exec sed "s/@version 0.5.3/@version 0.5.4/" -i {} \;

the files are all updated but svn doesn't recognize any change when executing one of theese

svn status ./source

svn diff ./source

svn commit ./source

i also tried to write a script which shpould check the $? from sed and it it's ok the "touch" the file to update it's mdate but sed seems to always return 0 -.-

what can i do now? -.-

  • I don't know of a sed implementation that has a -I option. You might have intended the -i option. Is this really the command you ran? – Gilles Sep 12 '10 at 11:58
  • sorry it was -i, sed itssef is working as i said... – Andreas Linden Sep 12 '10 at 12:04

The problem lies in your usage of find:

find dir1 -type f

Will match all files in the directory structure, including those inside the .svn directories. The files in .svn are those used to perform the svn diff against. So, in essence, you have modified all copies of the files in the tree, not just the working copies.

Try this syntax:

find ./source * -type f ! -path '*/.svn/*' -exec sed "s/@version 0.5.3/@version 0.5.4/" -I {} \;
  • i don't need backups, all is in svn... – Andreas Linden Sep 12 '10 at 12:04
  • @zolex You misunderstand. All the files in */.svn/text-base/ are backups of the files on the subversion server. DO NOT MODIFY THEM. – amphetamachine Sep 12 '10 at 12:27
  • btw, need to escape the dots on the version regex as it will find other things like 0x523 – Andreas Linden Sep 12 '10 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.