Thanks all for your questions.<br><br>I&#39;m stacked, though in another problem.<br>I have the script almost done but I&#39;m having a small problem.<br>I&#39;m doing an &quot;egrep &quot;REPLICATION CLIENT|ALL&quot; | wc -l&quot; after the mysql -pwhatever -e &quot;show grants for...etc&quot; all this is redirected to a file using normal &quot;&gt;&quot;.<br>
So:<br>for i in `cat file` do mysql -p -e &quot;show grants etc..&quot; &quot;egrep &quot;REPLICATION CLIENT|ALL&quot; | wc -l &gt; /tmp/whatever basically.<br><br>/tmp/whatever has the following &quot;format&quot;:<br>server1:0<br>
server2:1<br>server3:0<br>etc<br><br>I use another &quot;for&quot; to read this file and decide whether the database has the right privileges, if it has REPLICATION CLIENT or ALL privileges, &quot;wc -l&quot; will return 1 or more than 1, if it doesn&#39;t have any of them it will be a 0.<br>
<br>What&#39;s the problem? When I can&#39;t log into a mysql database (mostly cause it is down) I got a &quot;0&quot;, what I want is to discard these machines, so they&#39;re not included in /tmp/whatever.<br>I tried doing: grep -v &quot;ERROR&quot; and doing a 2&gt; /dev/null after the mysql -p -e &quot;show grants etc..&quot; but it doesn&#39;t work.<br>
<br>Any ideas?<br><br>Thanks you all a lot.<br>A<br>