Bug 16588

Summary: bug with ksh
Product: [Retired] Red Hat Linux Reporter: Need Real Name <gbouchez>
Component: zshAssignee: Trond Eivind Glomsrxd <teg>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-08-19 17:47:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2000-08-19 17:47:22 UTC
Hi,
i've scripts writen with ksh, to administrate Oracle Databases
my problem is:
i initialize a variable before a loop (while do...done)
next, in the loop , my variable increase (let a=a+1,...)
and when i leave the loop, my variable have the value before the loop
and not the value at the end of the loop !

Could you help me ?

I've a similar problem whith zsh and the values store in arrays
Thanks 

gbouchez

Comment 1 Trond Eivind Glomsrxd 2000-08-19 18:11:47 UTC
I can't reproduce this (zsh and ksh), they both seem to work like expected:

a=1
print $a
while true  ; do
    print $a;
    let a=a+1
    if [ $a -ge 21 ]; then
	break;
    fi
     
done

print "Done!"
print $a