Assemble an Array of Macs to shudown via ssh? I want to shutdown a few of my Macs remotely via an ssh script. I've got this so far:

#!/bin/bash

#Array of Mac hostnames separated by spaces
my_macs=(mac125 mac122 etc)

#Steps through each hostname and issues SSH command to that host

for n in my_macs
    do
       ssh pcpatch@$n 'sudo bash -s' &lt; ./documents/ShutdownUPTIME.sh
done

exit 0


When I run it though, it says:

ssh: Could not resolve hostname my_macs: nodename nor servname provided, or not known


Any ideas how to solve this issue?
Looping through the elements of an array.

my_macs=( mac125 mac122 etc )

for n in "${my_macs[@]}"
do
    ssh pcpatch@"${n}" 'sudo bash -s' &lt; ./documents/ShutdownUPTIME.sh
done