Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are several possiblities:</p> <p><strong>Using find:</strong></p> <p>Using find to create a list of all files, and then piping them to <code>sed</code> or the equivalent, as suggested in the answer you reference, is fairly straightforward, and only requires scanning through the files once.</p> <p>You'd use one of the same answers as from the question you referenced, but adding <code>-path '*/.svn' -prune -o</code> after the <code>find .</code> in order to prune out the SVN directories. See <a href="https://superuser.com/questions/207034/why-doesnt-find-prune-the-way-i-think-it-should">this question</a> for a discussion of using the <code>prune</code> option with <code>find</code> -- although note that they've got the pattern wrong. Thus, to print out all the files, you would use:</p> <pre><code>find . -path '*/.svn' -prune -o -type f -print </code></pre> <p>Then, you can pipe that into an <code>xargs</code> call or whatever to do the individual replacements, as suggested in the question you referenced. There is a lot of discussion there about different options, which I won't reproduce here, although I prefer the version from <a href="https://stackoverflow.com/questions/1583219/awk-sed-how-to-do-a-recursive-find-replace-of-a-string/1585810#1585810">John Zwinck's answer</a>:</p> <pre><code>find . -path '*/.svn' -prune -o -type f -exec sed -i 's/foo/bar/g' {} + </code></pre> <p><strong>Using recursive grep:</strong></p> <p>If you have a system with GNU grep, you can use that to find the list of files as well. This is probably less efficient than find, but it does allow you to only call <code>sed</code> on the files that match, and I personally find the syntax a lot easier to remember (or figure out from manpages):</p> <pre><code>sed -i 's/foo/bar/g' `grep -l -R --exclude-dir='*/.svn' 'foo' .` </code></pre> <p>The <code>-l</code> option causes grep to only output the list of file names, rather than the matching lines.</p> <p><strong>Using a GUI editor:</strong></p> <p>Alternately, if you're using windows, do what I do -- get a copy of the NoteTab editor (available in a free version), and use its search-and-replace-on-disk command, which ignores hidden .svn directories automatically and just works.</p> <p><strong>Edit:</strong> Corrected find pattern to <code>*/.svn</code> instead of <code>.svn</code>, added more details and some other possibilities. However, this depends on your platform and svn version: <code>.svn</code> without <code>*/</code> may be required in some cases, like on CentOS 7.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload