I'm attempting to run multiple commands via ssh on a shell script. From what I understand, the only way to do this, without copying scripts to each host, is to do ssh "host" then separate commands by ;

My problem is I have a pre-existing shell script (on a remote box) that outputs a list of names in which I want to iterate through using a for loop. This is all done remotely by the way. How would this look syntactically..as in

for i in "scriptname" do "commands" done

Where would the semicolons go? or is this even possible?