This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: typeset sem-failures in PD KSH v5.2.14 99/07/13.2
- From: Matt Wozniski <godlygeek at gmail dot com>
- To: pmcferrin at columbus dot rr dot com, cygwin at cygwin dot com
- Date: Sun, 20 Sep 2009 20:21:04 -0400
- Subject: Re: typeset sem-failures in PD KSH v5.2.14 99/07/13.2
- References: <4AB538A7.40401@columbus.rr.com>
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