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