Perl批量赋予可执行权限

2015-12-14 0 475
Perl批量赋予可执行权限
#!/usr/bin/perl
#use Cwd;
sub RightAll(){
	local($dir) = @_;
	opendir(DIR,"$dir"|| die "can't open $dir");
	local @files =readdir(DIR);
	closedir(DIR);
	for $file (@files){
		next if($file=~m/\.$/ || $file =~m/\.\.$/);
		if ($file =~/\.(sh|pl|bin|run|bundle|rb|py)$/i){
			system "chmod +x \"$dir\/$file\"";
		}
		elsif(-d "$dir/$file"){
			RightAll("$dir/$file" );
		}
	}
}
&RightAll(getcwd);

遇见资源网 perl Perl批量赋予可执行权限 http://www.ox520.com/13177.html

上一篇:

已经没有上一篇了!

下一篇:

已经没有下一篇了!

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务