#!/bin/bash
str="aaa,bbb,ccc,ddd"
OLD_IFS="$IFS"
IFS=","
arr=($str)
IFS="$OLD_IFS"
for s in ${arr[@]}
do
echo "$s"
done
linux系列:shell将字符串分割成数组
原创NIO4444 博主文章分类:【Linux进阶实战】 ©著作权
©著作权归作者所有:来自51CTO博客作者NIO4444的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
根据Nginx Ingress指标对指定后端进行HPA
基于nginx-ingress不同域名和访问路径的请求量弹性指定后端工作负载。
Deployment HPA nginx