From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fa528,5831375e51156f27 X-Google-Attributes: gidfa528,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!news.cpqcorp.net!53ab2750!not-for-mail From: "Tom Woodburn" Newsgroups: comp.unix.tru64 References: Subject: Re: expr bug ? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1478 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478 Message-ID: Date: Thu, 23 Dec 2004 17:08:53 GMT NNTP-Posting-Host: 16.140.16.145 X-Complaints-To: abuse@HP.com X-Trace: news.cpqcorp.net 1103821733 16.140.16.145 (Thu, 23 Dec 2004 09:08:53 PST) NNTP-Posting-Date: Thu, 23 Dec 2004 09:08:53 PST Organization: Hewlett-Packard Company Xref: g2news1.google.com comp.unix.tru64:449 Urs, Yes, the expr problem you mentioned was fixed in V5.0 of Tru64 UNIX and patches are available for earlier versions. The general problem is that expr strips leading zeroes. The fix is not turned on by default though. To turn it on, you need to run expr with the CMD_ENV environment variable set to "bsd". The expr(1) man page has been updated to mention that. Tom Woodburn HP "Urs Traber" wrote in message news:fcc8fc17.0412190627.708a5313@posting.google.com... > Hello all, > > I've come across a problem while building a software product kits that > should have a version code starting with 0, e.g. 097. My subset > control program (e.g. SSLBIN097.scp) sources > /usr/share/lib/shell/libscp, which is using expr to set _VCODE: > > _VCODE = `expr $_SUB : '^.*\(...\)$'` > > which would evaluate with the above scp script to > > _VCODE = `expr SSLBIN097 : '^.*\(...\)$'` > > and assign 97 to _VCODE - which is bad! Every reference to _VCODE in > libscp and all scp scripts causes buggy behaviour! Dependency locking, > creating backward links, etc. all doesn't work anymore. > > Variations like > > expr substr SSLBIN097 7 3 > > also produce 97 > > I've seen this behaviour on 4.0B, E and F systems. Before I come up > with a workaround: Does anyone know if "expr" has been fixed/changed > in a patch kit? > > Thanks for your help > Urs > > By the way: The GNU version of expr (contained in sh-utils 2.0) > produces 097.