Shortcuts in Science
Friday, 18 August 2017
Bash Associative Arrays
Cited from the Book "Pro Bash Programming"
Associative arrays, introduced in bash in version 4.0, use strings as subscripts and must be declared before being used.
$ declare -A array
$ for subscript in a b c d e
> do
> array[$subscript]="$subscript $RANDOM"
> done
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment