参见英文答案 >
How to split one string into multiple strings separated by at least one space in bash shell?7答案我意识到如何在Python中做,只是
line = db_file.readline() ll=string.split(line)
但是我怎么能在bash中做同样的事情呢?是真的可能做到这么简单的方法吗?
s='foo bar baz' a=( $s ) echo ${a[0]} echo ${a[1]} ...