Pasted your code into the file, adding the echo call just before ssh :
function func() { echo ssh server@server$1.ru .... } for server in {01..03} do func $server done
and ran:
$ bash файл ssh server@server01.ru .... ssh server@server02.ru .... ssh server@server03.ru ....
The output indicates that the parameter reads perfectly.
so if your program behaves differently than you expect, then either you expect from it is not what it actually is, or the error is not in the place that you assumed (non-transmitted function parameter).
in general it looks like you need something like gnu / parallel . good of them a lot .
#!/bin/bash,#!/bin/sh,#!/usr/bin/env bash. Give an example of working out the script. - Hellseherechocharacters (at the end of the space) in front of thesshcharacters and look at the result. - aleksandr barakin