📜  在 shell 脚本中拆分字符串 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:25.400000             🧑  作者: Mango

代码示例5
$ s='one_two_three_four_five'

$ A="$(cut -d'_' -f2 <<<"$s")"
$ echo "$A"
two

$ B="$(cut -d'_' -f4 <<<"$s")"
$ echo "$B"
four