Is this a KornSHell bug?
ofut at gitpyr.UUCP
ofut at gitpyr.UUCP
Thu Mar 5 00:27:19 AEST 1987
I found an interesting problem with the KSH arithmetic handling. The
example below executes a loop with a division inside. The first time
through, I get a division by zero error. The second time, the division
should work correctly. Unfortunately, the statement seems to have been
removed from the interpreter -- it's not executed at all.
#!/bin/ksh
#Jeff Offutt
X=9
Y=0
Z=0
for i in 1 2
do
(( Z = X / Y))
print "Z = "$Z
Y=3
done
Any ideas on that one? This occurs on a MicroVax with Ultrix V1.2 and
a Vax 11/780 with 4.3 BSD Unix.
On another note, is there any way to do math with real numbers with the
KShell? The manual doesn't actually say not, but it seems to indicate that
we can't.
--
Jeff Offutt
School of ICS, Georgia Tech, Atlanta Georgia, 30332
...!{akgua,allegra,amd,hplabs,ihnp4,seismo,ut-ngp}!gatech!gitpyr!ofut
More information about the Comp.unix.questions
mailing list