linux中,如果文件名中带括号,应先对括号处理,在“(”和“)”前加上“\”。Bracket_Handle给出了处理方法:
sub Bracket_Handle {
my ($tmp_name) = @_;
$tmp_name =~ s/\(/\\\(/g; # ( => \(
$tmp_name =~ s/\)/\\\)/g; # ) => \)
return $tmp_name;
}
如调用方法:
my $modem_make_file_name = &Bracket_Handle("$modem_make_file");
时间: 2024-10-14 17:03:00