Here is the fix:
INSTID="inst1 inst2 inst3"
FANCID="fac1 fac2 fac3"
for instid in $INSTID
do
echo ""
done
for fancid in $FANCID
do
echo "Instance on ${fancid} ${instid} instance"
done
done
exit 0
You forgot to close one of the for loops.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Ach, completely missed that first done before the second for.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Then use korn shell arrays and a single while loop as follows:
#!/bin/ksh
set -A INSTID inst1 inst2 inst3
set -A FANCID fac1 fac2 fac3
count=0
while [ $count -lt ${#INSTID[*]} ]
do
echo "Instance on ${fancid[$count]} ${instid[$count]} instance"
count=$(( $count + 1 ));
done
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Glad to hear it. Good luck, and have fun.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494