Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Create a script called <code>~/bin/svnfind</code>:</p> <pre><code>#!/bin/bash # # Attempts to behave identically to a plain `find' command while ignoring .svn/ # directories. OPTIONS=() PATHS=() EXPR=() while [[ $1 =~ ^-[HLP]+ ]]; do OPTIONS+=("$1") shift done while [[ $# -gt 0 ]] &amp;&amp; ! [[ $1 =~ '^[-(),!]' ]]; do PATHS+=("$1") shift done # If user's expression contains no action then we'll add the normally-implied # `-print'. ACTION=-print while [[ $# -gt 0 ]]; do case "$1" in -delete|-exec|-execdir|-fls|-fprint|-fprint0|-fprintf|-ok|-print|-okdir|-print0|-printf|-prune|-quit|-ls) ACTION=;; esac EXPR+=("$1") shift done if [[ ${#EXPR} -eq 0 ]]; then EXPR=(-true) fi exec -a "$(basename "$0")" find "${OPTIONS[@]}" "${PATHS[@]}" -name .svn -type d -prune -o '(' "${EXPR[@]}" ')' $ACTION </code></pre> <p>This script behaves identically to a plain <code>find</code> command but it prunes out <code>.svn</code> directories. Otherwise the behavior is identical.</p> <p>Example:</p> <pre><code># svnfind -name 'messages.*' -exec grep -Iw uint {} + ./messages.cpp: Log::verbose &lt;&lt; "Discarding out of date message: id " &lt;&lt; uint(olderMessage.id) ./messages.cpp: Log::verbose &lt;&lt; "Added to send queue: " &lt;&lt; *message &lt;&lt; ": id " &lt;&lt; uint(preparedMessage-&gt;id) ./messages.cpp: Log::error &lt;&lt; "Received message with invalid SHA-1 hash: id " &lt;&lt; uint(incomingMessage.id) ./messages.cpp: Log::verbose &lt;&lt; "Received " &lt;&lt; *message &lt;&lt; ": id " &lt;&lt; uint(incomingMessage.id) ./messages.cpp: Log::verbose &lt;&lt; "Sent message: id " &lt;&lt; uint(preparedMessage-&gt;id) ./messages.cpp: Log::verbose &lt;&lt; "Discarding unsent message: id " &lt;&lt; uint(preparedMessage-&gt;id) ./messages.cpp: for (uint i = 0; i &lt; 10 &amp;&amp; !_stopThreads; ++i) { ./virus/messages.cpp:void VsMessageProcessor::_progress(const string &amp;fileName, uint scanCount) ./virus/messages.cpp:ProgressMessage::ProgressMessage(const string &amp;fileName, uint scanCount) ./virus/messages.h: void _progress(const std::string &amp;fileName, uint scanCount); ./virus/messages.h: ProgressMessage(const std::string &amp;fileName, uint scanCount); ./virus/messages.h: uint _scanCount; </code></pre>
 

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