博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
shell 将字符串分割成数组
阅读量:3958 次
发布时间:2019-05-24

本文共 128 字,大约阅读时间需要 1 分钟。

#!/bin/basha="one,two,three,four"#要将$a分割开,可以这样:OLD_IFS="$IFS"IFS=","arr=($a)IFS="$OLD_IFS"for s in ${arr[@]}do    echo "$s" done

 

 

 

 

转载地址:http://fsazi.baihongyu.com/

你可能感兴趣的文章