1 # This program is free software: you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation, either version 3 of the License, or
4 # (at your option) any later version.
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 # GNU General Public License for more details.
11 # You should have received a copy of the GNU General Public License
12 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 # nameref variables as for loop index variables are special
26 set -- first second third fourth fifth
28 # unless you put a ${!v} in the for loop, ksh93 misbehaves
35 # example cribbed from ksh93 o'reilly book
37 second="I am in the middle"
41 for ref in first second third ; do
42 echo "ref -> ${!ref}, value: $ref"
44 echo final state: "ref -> ${!ref}, value: $ref"
51 for ref in one two three; do
52 echo "ref -> ${!ref}, value: $ref"
54 echo final state: "ref -> ${!ref}, value: $ref"
60 for ref in one two three; do
61 echo "ref -> ${!ref}, value: $ref"
63 echo final state: "ref -> ${!ref}, value: $ref"