tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brian moseley <...@maz.org>
Subject Re: cvs commit: jakarta-tomcat-jasper/jasper34/tools importRpl.pl pkgReplace.pl rmImport.pl
Date Wed, 06 Jun 2001 07:05:29 GMT

may i suggest something like:

  find . -name "*.java"|xargs perl -pie 's/import\s+foo\;/import\ bar\;/g'

:)

On 6 Jun 2001 costin@apache.org wrote:

> costin      01/06/05 23:51:29
>
>   Added:       jasper34/tools importRpl.pl pkgReplace.pl rmImport.pl
>   Log:
>   Ok, kill me - I used perl to avoid typing. Checked it in - might need it
>   later.
>
>   Revision  Changes    Path
>   1.1                  jakarta-tomcat-jasper/jasper34/tools/importRpl.pl
>
>   Index: importRpl.pl
>   ===================================================================
>   #!/usr/bin/perl
>
>   # Replace the "package" declaration
>
>   my $file = $ARGV[0];
>   my $temp = "temp";
>   open (FILE, $file) || die ("Can't open file $file :$! \n");
>
>   open (TEMP, ">$temp") || die( "Can't open file $file: $!\n");
>
>   while (<FILE>) {
>
>     s/import\s+($ARGV[1])\;/import\ $ARGV[2]\;/g;
>     print TEMP;
>
>   }
>
>
>   close(FILE);
>   close(TEMP);
>   rename($temp, $file);
>
>
>
>   1.1                  jakarta-tomcat-jasper/jasper34/tools/pkgReplace.pl
>
>   Index: pkgReplace.pl
>   ===================================================================
>   #!/usr/bin/perl
>
>   # Replace the "package" declaration
>
>   my $file = $ARGV[0];
>   my $temp = "temp";
>   open (FILE, $file) || die ("Can't open file $file :$! \n");
>
>   open (TEMP, ">$temp") || die( "Can't open file $file: $!\n");
>
>   while (<FILE>) {
>
>     s/package\s+(\S+)\;/package\ $ARGV[1]\;/g;
>     print TEMP;
>
>   }
>
>
>   close(FILE);
>   close(TEMP);
>   rename($temp, $file);
>
>
>
>   1.1                  jakarta-tomcat-jasper/jasper34/tools/rmImport.pl
>
>   Index: rmImport.pl
>   ===================================================================
>   #!/usr/bin/perl
>
>   # Replace the "package" declaration
>
>   my $file = $ARGV[0];
>   my $temp = "temp";
>   open (FILE, $file) || die ("Can't open file $file :$! \n");
>
>   open (TEMP, ">$temp") || die( "Can't open file $file: $!\n");
>
>   while (<FILE>) {
>
>     s/import\s+($ARGV[1])\;//g;
>     print TEMP;
>
>   }
>
>
>   close(FILE);
>   close(TEMP);
>   rename($temp, $file);
>
>
>
>


Mime
View raw message