A loop-renamed Shell

Source: Internet
Author: User

#!/bin/bash


db_ip=

Db_user=

Db_passwd=

Db_name=


a=98000000



function Addsql ()


{

Ine2=$1

Ine3=$2

#sql1 = "Update table name set list = ${ine2} where id= ${ine3};";

sql1= "Update table name set sex=0 where id= ${ine3};";

echo $sql 1

Mysql-u $DB _user-h ${db_ip}-p${db_passwd} $DB _name-e "$sql 1"



}



function Readname ()

{

While Read line

Do

Echo $line

sql1= "Update table name set column name = ' ${line} ' where id=${a};"

#sql1 = "Update table name set sex=0 where id= $a;";

Mysql-u $DB _user-h ${db_ip}-p${db_passwd} $DB _name-e "$sql 1"

#addsql $line $a



a=$ (($a + 1))

echo "Banana:" $a

If [$a-gt 98186387];

Then

Exit

Fi

Done </root/nickname20160616.txt

}


For ((t=0;t<=30;t++));

Do

Readname

echo "Pingguo:" $a

If [$a-gt 98186387];

Then

Exit

Fi

Done

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.