2a3
> 
4c5,6
< # Used with permission.
---
> # Used in ABS Guide with permission.
> # Fixups: 05 May 08, 04 Aug 08.
6,7c8,9
< #  In general, any string operation in the ${name ... } notation
< #+ can be applied to all string elements in an array
---
> #  In general, any string operation using the ${name ... } notation
> #+ can be applied to all string elements in an array,
17c19
<                         # All elements.
---
> #                ^        All elements.
20c22
<                         # All elements following element[0].
---
> #                ^        All elements following element[0].
23c25,28
<                         # Only the two elements after element[0].
---
> #                  ^      Only the two elements after element[0].
> 
> echo "---------"
> 
25c30
< echo "-----------------------"
---
> # Substring Removal
27,29c32
< #  Substring Removal
< #  Removes shortest match from front of string(s),
< #+ where the substring is a regular expression.
---
> # Removes shortest match from front of string(s).
32c35
<                         # Applied to all elements of the array.
---
> #               ^       # Applied to all elements of the array.
37c40
<                         # Applied to all elements of the array.
---
> #               ^^      # Applied to all elements of the array.
42c45
<                         # Applied to all elements of the array.
---
> #               ^       # Applied to all elements of the array.
47c50
<                         # Applied to all elements of the array.
---
> #               ^^      # Applied to all elements of the array.
50c53,54
< echo "-----------------------"
---
> echo "----------------------"
> 
54c58
< # Replace first occurance of substring with replacement
---
> # Replace first occurrence of substring with replacement.
56c60
<                             # Applied to all elements of the array.
---
> #               ^           # Applied to all elements of the array.
58c62
< # Replace all occurances of substring
---
> # Replace all occurrences of substring.
62,63c66,67
< # Delete all occurances of substring
< # Not specifing a replacement means 'delete'
---
> # Delete all occurrences of substring.
> # Not specifing a replacement defaults to 'delete' ...
65c69
<                             # Applied to all elements of the array.
---
> #               ^^          # Applied to all elements of the array.
67c71
< # Replace front-end occurances of substring
---
> # Replace front-end occurrences of substring.
69c73
<                             # Applied to all elements of the array.
---
> #                ^          # Applied to all elements of the array.
71c75
< # Replace back-end occurances of substring
---
> # Replace back-end occurrences of substring.
73c77
<                             # Applied to all elements of the array.
---
> #                ^          # Applied to all elements of the array.
76,78c80
<                             # Why?
< 
< echo "-----------------------"
---
> #                ^          # Why?
79a82
> echo "-----------------------------"
81,87d83
< # Before reaching for awk (or anything else) --
< # Recall:
< #   $( ... ) is command substitution.
< #   Functions run as a sub-process.
< #   Functions write their output to stdout.
< #   Assignment reads the function's stdout.
< #   The name[@] notation specifies a "for-each" operation.
89c85
< newstr() {
---
> replacement() {
93c89,90
< echo ${arrayZ[@]/%e/$(newstr)}
---
> echo ${arrayZ[@]/%e/$(replacement)}
> #                ^  ^^^^^^^^^^^^^^
95c92,93
< # Q.E.D: The replacement action is an 'assignment.'
---
> # The stdout of replacement() is the replacement string.
> # Q.E.D: The replacement action is, in effect, an 'assignment.'
97,99c95,102
< #  Accessing the "For-Each"
< echo ${arrayZ[@]//*/$(newstr optional_arguments)}
< #  Now, if Bash would just pass the matched string as $0
---
> echo "------------------------------------"
> 
> #  Accessing the "for-each":
> echo ${arrayZ[@]//*/$(replacement optional_arguments)}
> #                ^^ ^^^^^^^^^^^^^
> # !!! !!! !!! !!! !!! !!!
> 
> #  Now, if Bash would only pass the matched string
104a108,118
> 
> #  Before reaching for a Big Hammer -- Perl, Python, or all the rest --
> #  recall:
> #    $( ... ) is command substitution.
> #    A function runs as a sub-process.
> #    A function writes its output (if echo-ed) to stdout.
> #    Assignment, in conjunction with "echo" and command substitution,
> #+   can read a function's stdout.
> #    The name[@] notation specifies (the equivalent of) a "for-each"
> #+   operation.
> #  Bash is more powerful than you think!
