my $file="test.txt";
my $cmd="ls";
open(FILE,"> ".$file);
print FILE $cmd."\n";
system($cmd." >>$file");
close(FILE);
$cmd="date";
open(FILE,">> ".$file);
print FILE $cmd."\n";
system($cmd." >>$file");
close(FILE);
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/90618/viewspace-481931/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/90618/viewspace-481931/