标签: shell字符串转数组
thumbnail
new

shell字符串转数组怎么实现

在shell脚本中,可以使用read命令将字符串转换为数组。具体的实现方法如下: #!/bin/bash # 定义一个字符串 str="apple,banana,orange" # 将字符串……