linux for循环 包含变量

#!/bin/bash

a='{"data":{"deviceCode":"200319090000000012","schedulerId":"a8bbbc43382e4c148071b37c39ba9182","schedulerName":"测试任务名","serialNumber":"f543f3213cfd4b909d263f951addb8bd","sku":"123456","sourceName":"京东618","sourceUrl":"www.baidu.com","storeName":"Exhibition test store","styleId":"1032afe03c3947b38cf56b889e392382","styleName":"测试样式","tag":["糖果区","烟酒区"]},"merchantId":"1","requestId":"'

b='","storeCode":"HS001","storeId":"21","timeStamp":"1563787017940","type":"styleDelivery"}'

for((i=1;i<=100;i++));

do

/usr/local/bin/mosquitto_pub -u admin -P admin -m "$a$i$b" -t msg/alarm/styleDelivery

done

 

ab本来是一个完整的数据requestId是变量 因此采用aib拼接的方式

你可能感兴趣的:(linux,变量)