From: Bob Fulton <SYSTMGR () Z2100 ! SCS ! ZENITHE ! COM>
To: tru64-unix-managers
Subject: dUNIX 4.0b expr substr dropping leading zeros
Date: Wed, 17 Sep 1997 22:32:27 +0000 [thread overview]
Message-ID: <96078617110436.tru64-unix-managers.marc@archive.invalid> (raw)
Running the sh shell(/bin/sh) on dUNIX 3.2D-1
#c=`expr substr 0089 2 3`
#set
.
.
c=089
Running same shell on dUNIX 4.0b
#c=`expr substr 0089 2 3`
#set
.
.
c=89
Under 4.0b, if the string is 0000 instead of 0089, the result is 0,
not the result of 000 under 3.2D-1. Placing " around the 0000 did not
change the result.
The above example is simplified from actual use for clarity.
I have been told by CSC that expr was modified for POSIX
compliance and to use expr from 3.2 as a workaround.
Would a POSIX expert please indicate whether the 4.0b version
of expr for the substr operand is indeed acting "correctly"?
TIA
Bob Fulton
bob.fulton@zenithe.com
reply other threads:[~1997-09-17 22:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox