- 论坛徽章:
- 0
|
一个变量如下:
server=production_3"(机房二服务器)",production_4"(机房一服务器)",production_5"(机房一服务器)",production_7"(动名片机房一服务器)",production_8"(动名片机房二服务器)",production_gateway_1"(机房一网关)",production_gateway_2"(机房一网关)",production_gateway_3"(机房一网关)",production_gateway_4"(机房二网关)",production_money_wechat_1"(微信一服务器)",production_money_wechat_2"(微信二服务器)",production_web_1"(WEB一服务器)",production_web_2"(WEB二服务器)"
如何可以达到如下效果
[root@centos ~]# for i in `echo $server|sed 's/\,/ /g'`;do echo $i;done
production_3
production_4
production_5
production_7
production_8
production_gateway_1
production_gateway_2
production_gateway_3
production_gateway_4
production_money_wechat_1
production_money_wechat_2
production_web_1
production_web_2
|
|