From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/9287 Path: main.gmane.org!not-for-mail From: Taco Newsgroups: gmane.comp.tex.context Subject: Re: getting context's version Date: Tue, 17 Sep 2002 20:28:29 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <20020917202829.095afd5a.taco@elvenkind.com> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035399629 2069 80.91.224.250 (23 Oct 2002 19:00:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 19:00:29 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: "Wybo Dekker" In-Reply-To: Xref: main.gmane.org gmane.comp.tex.context:9287 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:9287 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"; =~ /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" 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() { > /ver:\s+(\d+)\.(\d+)\.(\d+)/ and > $version=sprintf("%4d%02d%02d",$1,$2,$3),last; > } > print "version=$version\n"; > > -- > Wybo