Guest User

Untitled

a guest
Jul 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. var="a:b:c"
  2. OLDIFS=$IFS
  3. IFS=":"
  4. read -a array <<< "$(printf "%s" "$var")"
  5. IFS=$OLDIFS
  6. echo ${#array[@]}
  7. echo ${array[0]}
  8. echo ${array[1]}
  9. echo ${array[2]}
Add Comment
Please, Sign In to add comment