#!/bin/bash echo "测试...................." MysqL="MysqL -h127.0.0.1 -P3306 -uroot -p123456 MysqLdb" selectMaxOrderId="select max(Forder_id) from t_order" cnt=$($MysqL -s -e "${selectMaxOrderId}") orderIds="${cnt}" #OLD_IFS="$IFS" #IFS=" " #max(Forder_id) 3013759 values=(${orderIds}) #IFS="$OLD_IFS" orderId=${values[0]} echo $orderId orderId=$[$orderId+1] echo $orderId placeOrder="INSERT INTO t_mytable VALUES ("$orderId");" echo $placeOrder $MysqL -e "$placeOrder" updateOrderStatus="update .......... set Fstatus=10 where Forder_id=$orderId;" $MysqL -e "$updateOrderStatus" extention="INSERT INTO ................" $MysqL -e "$extention" data='' url='127.0.0.1:80' curl -d "$data" "$url"
原文链接:https://www.f2er.com/bash/388957.html