1 2 3 4 5 6 7 8 9 10 11 12 13 14
| #!/bin/bash user=root pwd=password DB=test TABLE=md5 mysql -u$user -p$pwd -e "USE $DB;CREATE TABLE $TABLE(id int not null primary key auto_increment,md5 text(32),plain varchar(100));" while read line do md5=`echo $linemd5sumawk -F " " '{print $1}'`
mysql -u$user -p$pwd -e "USE $DB;INSERT $TABLE (md5,plain) VALUES('$md5','$line');" done < plaindic
|