snipt

Ctrl+h for KB shortcuts

MuPAD

check syntax of all php files before an svn commit

for i in `svn status | egrep '^(M|A)' | sed -r 's/\+\s+//' | awk '{ print $2 }'` ; do if [ ! -d $i ] ; then php -l $i ; fi ; done
https://snipt.net/embed/e51cba722b07c0cc5a071d1fcd32b95f/
/raw/e51cba722b07c0cc5a071d1fcd32b95f/
e51cba722b07c0cc5a071d1fcd32b95f
mupad
MuPAD
1
2019-06-26T06:21:03
True
False
False
/api/public/snipt/30883/
check-syntax-of-all-php-files-before-an-svn-commit
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">for</span> <span class="nv">i</span> <span class="ow">in</span> <span class="nv">`svn status | egrep &#39;^(M|A)&#39; | sed -r &#39;s/\+\s+//&#39; | awk &#39;{ print $2 }&#39;`</span> <span class="o">;</span> <span class="k">do</span> <span class="k">if</span> <span class="p">[</span> <span class="o">!</span> <span class="o">-</span><span class="nv">d</span> <span class="o">$</span><span class="nv">i</span> <span class="p">]</span> <span class="o">;</span> <span class="k">then</span> <span class="nv">php</span> <span class="o">-</span><span class="nv">l</span> <span class="o">$</span><span class="nv">i</span> <span class="o">;</span> <span class="nv">fi</span> <span class="o">;</span> <span class="nv">done</span> </span></pre></div> </td></tr></table>
bash, php, subversion, svn