where the text is in an input
file in the same directory, and result is given in output
file.
cat ./input | sed -e 's/+------+------+//g' | sed -e 's/| Id | User |//g' | sed -e 's/ | root |//g' | tr -d "\n" | sed -e 's/| /,/g' | sed -e 's/ ,/,/g' | sed -e 's/ ,/,/g' > output
When I did it your example I got:
+------+------,8192,8194,8202,8245,8434,8754,8761,8762,8764,8771
That may because the top line of your example was missing a +
- there may be a few other errors...
Then I think you just need to add sudo /mysql_rms/bin/mysqladmin -S /mysql_rms/var/mysql_rms.sock -p kill
at the beginning
Or, in what is hopefully a slight improvement on what Radu suggested (also based on the above input):
cat ./input | sed 's/[+-]*//g' | sed 's/ | root |//g' | tr -d "\n" | sed 's/| /,/g' | sed 's/ ,/,/g' | sed 's/ ,/,/g' | sed 's/^,//' | sed 's/,[0-9]* $/\n/' | sed 's/Id//g' | sed 's/,User,,//g' | sed 's/ //g' > output
Then, based on you Q&A here, you should be able to run:
sudo /mysql_rms/bin/mysqladmin -S /mysql_rms/var/mysql_rms.sock -p kill $(cat ./output)
although you may want to check whether it is the right command with this first:
echo "sudo /mysql_rms/bin/mysqladmin -S /mysql_rms/var/mysql_rms.sock -p kill $(cat ./output)"