#!/bin/bash HOST='localhost' USER='neo' PASS='chen' SDB='neo' TDB='netkiller' MYSQLDUMP="mysqldump" MYSQLDUMPOPTS="-h${HOST} -u${USER} -p${PASS}" MYSQL="mysql" MYSQLOPTS="-h${HOST} -u${USER} -p${PASS}" #SED="sed -e 's/netkiller\.8800\.org/netkiller\.sf\.net/g' -e 's/陈景峰/景峰/g' -e 's/Neo/Netkiller/g'" $MYSQL $MYSQLOPTS <<SQL DROP DATABASE $TDB; CREATE DATABASE $TDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; SQL $MYSQLDUMP $MYSQLDUMPOPTS ${SDB} | sed -e 's/netkiller\.8800\.org/netkiller\.sf\.net/g' -e 's/陈景峰/景峰/g' -e 's/Neo/Netkiller/g' | $MYSQL $MYSQLOPTS ${TDB} #echo "$MYSQLDUMP $MYSQLDUMPOPTS ${SDB} | $SED | $MYSQL $MYSQLOPTS ${TDB}"
Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。