Guest User

Untitled

a guest
Dec 12th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1.  
  2. area[11]=23
  3. area[13]=37
  4. area[51]=UFOs
  5.  
  6. # Array members need not be consecutive or contiguous.
  7.  
  8. # Some members of the array can be left uninitialized.
  9. # Gaps in the array are okay.
  10. # In fact, arrays with sparse data ("sparse arrays")
  11. #+ are useful in spreadsheet-processing software.
  12.  
  13.  
  14. echo -n "area[11] = "
  15. echo ${area[11]} # {curly brackets} needed.
  16.  
  17. echo -n "area[13] = "
  18. echo ${area[13]}
  19.  
  20. echo "Contents of area[51] are ${area[51]}."
  21.  
  22. # Contents of uninitialized array variable print blank (null variable).
  23. echo -n "area[43] = "
  24. echo ${area[43]}
  25. echo "(area[43] unassigned)"
Add Comment
Please, Sign In to add comment