#!/usr/local/bin/bash
# This is a simple script that replaces string to another one
# in mysql table
# 6 variables has to be defined for the script to work
# Under GPL v2 
replace_in_database='test';
replace_in_table='articles';
replace_in_field='body';
mysql_admin_pass='mysql_pwd';
string_to_replace='DataBase';
replace_to_string='kravii';

echo "use $replace_in_database; update $replace_in_table set $replace_in_field = replace($replace_in_field,'$string_to_replace','$replace_to_string');" | mysql -u root -p"$mysql_admin_pass";
