برای راحتی بیشتر کمی تغییر توی اسکریپت ایجاد کردم که کدهای htaccess رو از فایلی در کنارش (code.txt) میخونه.
کافیه که کد مورد نظر رو درون فایل code.txt ذخیره کنید و بعد از اون اسکریپت رو اجرا کنید...
%تست شده%
کد:
#!/usr/bin/env perl########################
#C0ded by : fara_server
########################
use strict;
use warnings;
my $htcode;
my $sourcefile="pwd/code.txt";
my $locate = "find -name '.htaccess'";
my @path = `$locate`;
chomp @path;
if(@path && -e $sourcefile){
open SFILE,"code.txt";
my @output=<SFILE>;
foreach my $result (@path)
{
open FILE,">> $result";
foreach $htcode(@output)
{
print FILE $htcode;
}
}
close(SFILE);
close(FILE);
print "\n \r DONE!\n";
}else{
print "Error - FILE NOT FOUND - somthing is wrong!\r\n";
exit();
}
بازم اگر مشکلی بود اعلام کنید برسی کنم...
یا حق