1、
抓取网页更改编码
#!/bin/bash
url=$1
temp=html
curl $1|iconv -f gbk
-t utf-8 -o $temp
2、
导入数据库
#!/bin/bash
myfile=$1
while read
line
do
song=`echo $line|awk '{print $1}'`
singer=`echo $line|awk
'{print $2}'`
mysql -uroot -D mp3 -e "set names utf8;insert into
m_manage_toplist(song_name,singer_name) values ('$song','$singer');"
done
< $myfile
阅读(1224) | 评论(0) | 转发(1) |