[CS-FSLUG] Script-error

Jukka Y mail at ylonen.info
Thu May 13 10:40:56 CDT 2004


It works now! Many thanks for you, Brian :-). I can now more easily squeese 
some 5 Gb of loosely compressed jpg's into djvu-format (my goal is to put 
them on single 700 Mb cdrom with no visible loss of quality, with 
thumbnail-index etc etc...;-).

I did find out that error which I mentioned my last message ("Unrecognized 
character \xA0 at convert line 10") was caused by "blanks" which I may got 
from copying Jonathans script directly from KMail's window). But there was 
also something else, because after removing "blanks" interpreter warned me 
with this message: "Can't find string terminator "EOF" anywhere before EOF 
at ./convert line 12." Maybe this had something to with what you mentioned 
about giving multiple commands to system()..?

Thanks also for line-numbering tip :-). In case you are interested to see what 
caused the second error, script had this numbering:

1	#!/usr/bin/perl
2
3	use strict;
4	use warnings;
5
6	my $filelist = `find`;
7	my @files = split /\n/,$filelist;
8
9	for my $file (@files)
10	{next unless ($file =~ m#\.jpg$#);
11	$file =~ s#\.[^/]*$##;
12	system (<<EOF);
13	convert '$file.jpg' '$file.pnm' &&
14	rm '$file.jpg' &&
15	c44 '$file.pnm' '$file.djvu' &&
16	rm '$file.pnm'
17	EOF}

Perl is something I would like to learn (I have even bought a book of it). 
Btw. Did you know that Larry Wall - the guy that originally wrote 
perl-interpreter - is christian?

Blessings,
Jukka

On Thursday 13 May 2004 17:45, Brian Derr wrote:
[snip]
> Here is my updated script, try this out...I don't have c44 on my system
> so I couldn't fully test this.
>
>
>      1	#!/usr/bin/perl
>
>      2	use strict;
>      3	use warnings;
>      4
>      5	my $filelist = `find`;
>      6	my @files = split /\n/,$filelist;
>      7	for my $file (@files) {
>      8	   next unless ($file =~ m#\.jpg$#);
>      9	   $file =~ s#\.[^/]*$##;
>
>     10	   my @cmdlist = <<EOF;
>     11	convert '$file.jpg' '$file.pnm'
>     12	rm '$file.jpg'
>     13	c44 '$file.pnm' '$file.djvu'
>     14	rm '$file.pnm'
>     15	EOF
>
>     16	   system ( @cmdlist );
>     17	}
>
> Let me know if this works.  I think the problem is that you cannot give
> multiple commands to system() the way you did.  I could easily be wrong
> though.  :-D
>
> Brian





More information about the Christiansource mailing list