首页
mac
it
登录
6mi
u
盘
搜
搜 索
it
shell 将字符串分割成数组
shell 将字符串分割成数组
mac
2024-11-21
27
#!/bin/bash a="one,two,three,four" #要将$a分割开,可以这样: OLD_IFS="$IFS" IFS="," arr=($a) IFS="$OLD_IFS" for s in ${arr[@]} do echo "$s" done
转载请注明原文地址: https://mac.8miu.com/read-497958.html
最新回复
(
0
)