Hi guys, <br><br>I&#39;m trying to create an script to verify some databases and their privileges.<br><br>I have all of them in some files with the following format:<br>server1<br>server2<br>server3<br>server4<br><br>Being all of them MySQL servers and the first one the master and the rest of the just the slaves.<br>
<br>I only want to check the privileges in the slaves and I&#39;ve created the following statement:<br>for i in `cat file1_cluster`; do echo -n $i: &amp;&amp; mysql -h$i -uroot -pwhatever -e&quot;show grants for &#39;user&#39;@&#39;10.10.%.%&#39;;&quot; | grep -i &quot;REPLICATION CLIENT&quot; | wc -l ; done &gt; /tmp/privs<br>
<br>Keep in mind I just want to know the slaves which doesn&#39;t have the REPLICATION CLIENT privileges, just that.<br>So that will write in /tmp/privs something like:<br>server1:0<br>server2:1<br>server3:0<br><br>Being the value 0 a machine which doesn&#39;t have REPLICATION CLIENT privilege and 1 being the value which mean it does.<br>
<br>The thing is, how can I do the &quot;for&quot; loop to avoid reading the first line of the file: file1_cluster, file2_cluster etc...cause the master will never have replication client privileges.<br><br>After reading the /tmp/privs with another for, I will use cut -d &quot;:&quot; -f to look for values distinct from 0 and do a mail -s to the admins.<br>
<br>Any help will be more than appreciated.<br><br>Thanks a lot<br>A<br>