perl script to copy your xbmp *.tbn to folder.jpg
#1
it copies the foldername.tbn to foldername/folder.jpg.

paste the code into an file, then chmod 755 filename. go to the dir where the tbn files are, call the script.

mayby not the best script but it works.
Quote:#!/usr/bin/perl

$dir = ".";
opendir(dir, "$dir");
my @files = readdir(dir);
for $i (@files)
{
 if ($i =~ /.*\.tbn$/)
 {
   $filename = $i;
   $dirname = $i;
   $filename =~ s/.*\.tbn$/folder\.jpg/i;
   $dirname =~ s/\.tbn$//i;
   $l = "\"";
   $filename = $filename.$l;
   $dirname = $l.$dirname."/";
   $dest = $dirname.$filename;
   $i = $l.$i.$l;
   print "$dest\n";
   unless (-e $j)
   {
      `cp $i $dest`;
   }
 }
}
Reply

Logout Mark Read Team Forum Stats Members Help
perl script to copy your xbmp *.tbn to folder.jpg0