Guest User

Untitled

a guest
May 27th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. ARRAY=( "cow:moo"
  2. "dinosaur:roar"
  3. "bird:chirp"
  4. "bash:rock" )
  5.  
  6. for animal in "${ARRAY[@]}" ; do
  7. KEY=${animal%%:*}
  8. VALUE=${animal#*:}
  9. printf "%s likes to %s.\n" "$KEY" "$VALUE"
  10. done
Add Comment
Please, Sign In to add comment