Are you aware why the next is just not changing string into array?

  STR="one two three"
  array=("$STR")

  echo "${array[@]}" # prints: one two three
  echo "len: ${#array[@]}" # prints: len: 1
  echo "merchandise: ${array[0]}" # prints: <nothing>

log in to reply this query.


Browse different questions tagged bash zsh .