I can run the followind loop locally
for i in A B C; do mycommand $i; done
Now I am trying to send it over ssh
The following version
ssh myhost for i in A B C; do mycommand $i; done
The following version
ssh myhost "for i in A B C; do mycommand $i; done"
also fails, because it wants i varibale locally.
How to handle?
Is there any general approach, for example, what if mycommand is another ssh?
ssh myhost 'for i in hos1 host2 host3; do ssh "$i" ... another for expression