Made some changes and exported my variables and tried creating a second while loop but still having no luck:
Code:
while read -r VMNAME
do
if [ "$MRLVMS" -ne 0 ]
then
select MRLPROXY in "${removed[@]}" ; do
case $MRLPROXY in
*_100_sun)
echo -e "Adding $VMNAME to removed on Sunday's schedule"
MRLVMS=$(($MRLVMS - 1))
;;
*_100_mon)
echo -e "Adding $VMNAME to removed on Monday's schedule"
;;
esac
done
fi
done < $NEWMRLVMS
It now will only echo the array once but still does not wait for user response on the select statement?? I also tried using a an echo & read combo but same result.
Here is the output from the loop:
Code:
1) 27_103_sun 7) 22_103_sat 13) 26_101_fri 19) 19_102_thur
2) 18_103_mon 8) 29_101_sun 14) 21_101_sat 20) 26_102_fri
3) 18_103_tue 9) 30_101_mon 15) 18_102_sun 21) 21_102_sat
4) 20_103_wed 10) 30_101_tue 16) 30_102_mon
5) 21_103_thur 11) 30_101_wed 17) 18_102_tue
6) 24_103_fri 12) 23_101_thur 18) 21_102_wed
#? #? #? #? #? #? #? #? #? #? #? #? #? #? #? #? #? #? #?
You can see that the select is sent to the terminal 19 times which is the integer value of $MRLVMS so the loop part of the loop works just fine just need to figure out a way to get it to stop on each iteration of the loop and wait for user input so I can execute commands based on that input.