From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/9293 Path: main.gmane.org!not-for-mail From: Wybo Dekker Newsgroups: gmane.comp.tex.context Subject: Re: getting context's version Date: Tue, 17 Sep 2002 23:20:42 +0200 (CEST) Sender: owner-ntg-context@let.uu.nl Message-ID: References: <20020917202829.095afd5a.taco@elvenkind.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1035399634 2104 80.91.224.250 (23 Oct 2002 19:00:34 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 19:00:34 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: Taco In-Reply-To: <20020917202829.095afd5a.taco@elvenkind.com> Xref: main.gmane.org gmane.comp.tex.context:9293 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:9293 On Tue, 17 Sep 2002, Taco wrote: > > > 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"; That's better, thanks. But it slurps the whole file, so I made it: #!/usr/bin/perl -w open(IN,`kpsewhich context.tex`) or die "can't find context.tex"; while() { /contextversion\{(\d+)\.(\d+)\.(\d+)\}/ and printf("version=%4d%02d%02d\n",$1,$2,$3),last; } -- Wybo