远程批量查询sql脚本
for i in {1..50}
do
sql_ip=172.168.0.${i}
 
information=`mysql -h ${sql_ip} -uroot -ppassword dbname -e 'select name,value from setting where name = "name" UNION select name,value from setting where name = "code" ' |grep -v val
ue|awk -F ' ' '{print $2}'|awk -F '\\' '{print $3}'`
 
echo ${information} > information.txt
code=`cat information.txt`
token_tab=`mysql -h ${sql_ip} -uroot -ppassword dbname -e 'select name,value from setting where name = "token"'|grep -v value|awk -F '\\' '{print $3}'`
echo ${token_tab} > token_file.txt
sed 's/0//g' token_file.txt > token.txt
token=`cat token.txt`
echo "${token} this name is "${code}"" >> integ.txt
done

相关文章:

  • 2021-07-17
  • 2021-12-13
  • 2022-03-09
  • 2021-11-16
  • 2021-08-20
  • 2022-12-23
  • 2021-10-22
  • 2022-12-23
猜你喜欢
  • 2022-01-05
  • 2022-01-18
  • 2022-12-23
  • 2021-09-21
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案