通过输入用户id 查询出正式机用户密码
#!/bin/sh
function findPassword(){
read -p "please input memberId:" memberId
echo "$memberId" | awk '{printf "select pwd_2 from core_user.MemberLoginInfo_%02d where memberId=%d;",$1%100,$1}' | mysql -uuserName -ppassword -h10.10.10.01
}
findPassword
插入日志到数据库
#!/bin/sh
function insertSql(){
cat /www/logs/$1 | awk -F"|" '{print "insert into user_login_third (snsType,snsAccount,snsUserName,ip,loginTime) values ("$2",\047"$5"\047,"$4",\047"$3"\047,\047"$6"\047);"}' |mysql -uuserName -ppassword -h10.10.10.01
datebase_Msg
}
function passParam(){
echo "" | awk '{for(i=1;i<30;i++){printf("%02d\n",i);}}'
}
function main() {
passParam | while read num
do
insertSql "LoginLog.log.2012-03-"$num 2> /dev/null
done
}
main