|Text-only||Table of Contents (frame/ no frame)|
ksh distinguishes between numerically indexed (small) arrays, and string indexed (associative) arrays.
bash uses integers for all array indexing, but the integers need not be consecutive and unassigned array elements
do not exist. Arrays must be declared before use, e,g.
typeset -A myarray (ksh associative array), or
typeset -a myarray (bash).
Array elements are set with the syntax:
and referenced with the syntax
This example shows use of an array indexed by IP addresses, as strings in ksh or as non-consecutive numbers in bash. It also demonstrates use of getopt for options processing
Example: getauthlogs display, text
|arrays.src last modified Mar 22, 2012||Introduction||Table of Contents
|© Dartmouth College|