-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
#!/usr/bin/expect
set USER "test"
set HOST "10.10.10.10"
foreach j {0 1 2 3 4 5 6 7 } {
set DATABASE ""
append DATABASE "db00" $j
spawn mysql -h $HOST -u $USER $DATABASE -p
expect "*password*"
send "PASSWORD\n"
expect "*mysql*"
for {set i 0} {$i < 16} {incr i 1} {
set TABLE ""
set no 0
set no [expr $j * 16 + $i]
if { $no < 100 } {
append TABLE "table00" $no
} else {
append TABLE "table0" $no
}
send "alter table $TABLE add column `ratio` varchar(8) NOT NULL DEFAULT '1-1' COMMENT '当前红包使用比例,默认1:1';\r\n"
expect "*mysql*"
}
expect "*mysql*"
send "exit;\n"
}
interact
Metadata
Metadata
Assignees
Labels
No labels