4 hele regels code, ik schaam me.
groetjes, Taco
#!/usr/bin/perl -w
local $/;
open(IN,`kpsewhich context.tex`) || die "can't find context.tex";
<IN> =~ /contextversion\{(\d+)\.(\d+)\.(\d+)\}/;
print "version=" . sprintf("%4d%02d%02d",$1,$2,$3) . "\n";
On Tue, 17 Sep 2002 12:07:08 +0200 (CEST)
"Wybo Dekker" <[EMAIL PROTECTED]> wrote:
> I want to check context's version in a perl script to verify that it's
> recent enough. Is there a better way than this?:
>
> #!/usr/bin/perl -w
> open(IN,"echo '\\bye' |cont-en |") or
> die "Could not run cont-en\n";
> while(<IN>) {
> /ver:\s+(\d+)\.(\d+)\.(\d+)/ and
> $version=sprintf("%4d%02d%02d",$1,$2,$3),last;
> }
> print "version=$version\n";
>
> --
> Wybo