⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 insert_licence_mfiles.pl

📁 时频分析的工具包
💻 PL
字号:
#!/bin/perl#-------------------------------------------------#the script changes the confidential text by #that of the license CeCILL .##-------------------------------------------------use strict;my $tftb_root = "mfiles";@ARGV = "$tftb_root";my $dir = $ARGV[0];ListRep($dir);sub ListRep {     my ($dir) = @_;     if (! -e $dir ) {     print "Unknown directory ($dir).";     return undef;     }        if (! -d $dir ) {     print "$dir is not a directory";     return undef;     }             if (! opendir( DIR, $dir) ) {     print "Impossible to open the directory $dir : $!.";     return undef;     }          my @files = grep !/(?:^\.$)|(?:^\.\.$)/, readdir DIR;     closedir DIR;           print "\nFiles contained\n";     foreach(@files) {        print $_."\n";        if ($_ =~ /\.m$/i) 	{ 			my $mo="CONFIDENTIAL PROGRAM";		my $nblinet = 1;		my $nbline = 1;		my $line;				open (FILE, "<$tftb_root/$_") || die "impossible to open $_.";			while($line=<FILE>)		{			$nblinet++;		}		close (FILE);						open (TEMP, ">>$tftb_root/temp.log") || die "impossible to open temp.log";		open (FILE, "<$tftb_root/$_") || die "impossible to open $_.";		while(($line=<FILE>) and ($line !~ /$mo/))		{			print TEMP $line;			$nbline++;		}		close (FILE);				open (ENTETE, "< licence") || die "impossible to open entete";		while (my $line = <ENTETE>)	   	{			print TEMP "$line";	   	}	     	close (ENTETE);						$nbline=$nbline+3;		open (FILE, "<$tftb_root/$_") || die "impossible to open $_.";		my @tab=<FILE>;		for($nbline..$nblinet)            	{			print TEMP "$tab[$_]";			}		  			close (FILE);		close (TEMP);						`rm $tftb_root/$_`;		`mv $tftb_root/temp.log $tftb_root/$_`;						}    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -