From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078617110436.tru64-unix-managers.marc@archive.invalid> From: Bob Fulton Date: Wed, 17 Sep 1997 22:32:27 +0000 To: tru64-unix-managers Subject: dUNIX 4.0b expr substr dropping leading zeros X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078617110436 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