lhunath 1337783449 learn mysqlquote() { local arg=${1//\\/\\\\}; printf %s "'${arg//\'/\'}'"; }; mysql <<< "UPDATE table SET foo=$(mysqlquote "$foo")"