This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: typeset sem-failures in PD KSH v5.2.14 99/07/13.2


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]