Jag blockade lite kod från internet. skrev lite själv, det ser bra ut men jag förstår inte varför jag får unexpected EOF while looking for matching `"'

det har något med raden "vm=${test[$i]}"" att göra
#!/bin/bash
#Johnnys lilla loop
test[0]="bc32-526a-46f0-b22c-3a8a9bf0"
test[1]="7980241-9a08-499b-923d-c556e751"
test[2]="73e1f98e-af54-4bc5-8f0a-77ee36"
test[3]="4ca028-4d4a-4866-9a67-dce0b6e"
for ((i=0;i<=2;i++)); do
vm=${test[$i]}"
# how long in seconds we will wait for gracefull shutdown before force poweroff
timeout=20
#logger "$0 running with [$*]..."
start() {
# we place EXEC for hack. We need to hide VBoxHeadless PID from systemd. In the other case, in the stop() we must wait until VBoxHeadless exit, but we do not need it.
exec VBoxHeadless --startvm "$vm" 2>&1 | logger &
exit $?
}
stop() {
echo -n "Try to stop VM..."
vboxmanage controlvm "$vm" acpipowerbutton
#vboxmanage controlvm "$vm" savestate
# next, we need to wait until VM is stopped
for i in `seq 1 $timeout`;
do
if ! VBoxManage list runningvms | grep $vm >/dev/null; then
echo "done!"
#sleep 1
exit 0
fi
echo -n .
sleep 1;
done
echo "save state failed. Forced poweroff."
vboxmanage controlvm "$vm" poweroff
sleep 1
exit 0
}
status() {
echo "Running machines:"
vboxmanage list runningvms
}
case $1 in
start|stop|status) "$1"
;;
*) echo "Usage: $0 [sart|stop|status]"
exit 1
;;
esac
Done
Referens: https://ubuntuforums.org/showthread.php?t=2387221