You can use /did commands with multiple IDs. Just do that.

Example:
/did -u $dname 1,2,3,4,5,6,7,8

Or, put all of the IDs into a variable and use:
/did -u $dname %IDs