On Sat, Sep 19, 2009 at 4:01 PM, Paul McFerrin wrote: > Hello: > > The following simple script fails to produce a leading "0" on variable > "nextnum". Am I doing something wrong or did I discover a bug? > > PD KSH v5.2.14 99/07/13.2 > /home/paul.$ cat /lbin/testit2 > #!/bin/pdksh > n="06" > typeset -L2 nextnum > nextnum=`expr $n + 01` > echo $nextnum > > /home/paul.$ /lbin/testit2 7
Looks like the correct behavior to me - the result is 7 (which is 06 + 1) left aligned, just like you asked for. Were you looking for "typeset -Z2" instead, for right aligned with zero padding in a field of width two? ~Matt -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple