#!/usr/bin/perl -w use strict; my $msg = "Please turn off your machines"; my $cont = 1; while($cont<=10){ system("echo $msg | smbclient -M mach-${cont}"); $cont=$cont+1; }