Add-on: [CS-FSLUG] Alarm for command-line processes?

Jonathan Rupp jdr157 at flashmail.com
Sat May 8 07:32:04 CDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jukka,

| Now you could also use the "find" command to run the script
recoursively...

Like this (perl script):

#!/usr/bin/perl

use strict;
use warnings;

my $filelist = `find`;
my @files = split /\n/,$filelist;

for my $file (@files)
~    {
~    next unless ($file =~ m#\.jpg$#);
~    $file =~ s#\.[^/]*$##;
~    system(<<EOF);
convert '$file.jpg' '$file.pnm' &&
rm '$file.jpg' &&
c44 '$file.pnm' '$file.djvu' &&
rm '$file.pnm'
EOF
~    }

That should process all jpgs in all subdirectories of the place where
you run the script.

Jonathan Rupp
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAnNNEYg2b4r1bC2ARAqYPAJ9vsXFtwJcCJEOhyJ9t9VC1pFErGQCeNpV1
0wGbM/wXop4UVZ5u0/ZqWNQ=
=mFIH
-----END PGP SIGNATURE-----




More information about the Christiansource mailing list