... my $regexpaaa=qq/-i -e \'\^AAA=\'/; my @command2 = ("ssh us\@ip -o BatchMode=yes grep $regexpaaa $dir/$file"); ...