* expr bug ?
@ 2004-12-19 14:27 Urs Traber
2004-12-23 17:08 ` Tom Woodburn
0 siblings, 1 reply; 2+ messages in thread
From: Urs Traber @ 2004-12-19 14:27 UTC (permalink / raw)
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: expr bug ?
2004-12-19 14:27 expr bug ? Urs Traber
@ 2004-12-23 17:08 ` Tom Woodburn
0 siblings, 0 replies; 2+ messages in thread
From: Tom Woodburn @ 2004-12-23 17:08 UTC (permalink / raw)
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" <urs.traber@swissonline.ch> 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-12-23 17:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-19 14:27 expr bug ? Urs Traber
2004-12-23 17:08 ` Tom Woodburn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox