1.

Solve : How can I add successfully in my perl script?

Answer»

I need help adding this:

tr -d '\r'

into this script.


#!/usr/bin/perl -w

open(DIR, "ls -1b *ACH.*|")
or DIE "Can't open due to $!";

@files = ;
close(DIR);

foreach $file (@files) {
chomp($file);
$newfile = "EDSATM".substr($file, -11,4);
$newfile =~ s/-//g;
print "Executing mv $file $newfile\n";
system "mv $file $newfile";
}
# END CODE SNIPPET ############



Discussion

No Comment Found