Bug 3694 - shell variables exhibit scoping behavior
Summary: shell variables exhibit scoping behavior
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: bash
Version: 5.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Cristian Gafton
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-06-24 03:48 UTC by davidmo
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 1999-07-02 21:45:34 UTC
Embargoed:


Attachments (Terms of Use)

Description davidmo 1999-06-24 03:48:10 UTC
Shell variables seem to exhibit local scoping behavior.
Example:
#!/bin/sh
i=0
cnt=0
while [ i -lt 5 ]
do
   cnt=$cnt+1
   echo $cnt
   i=$i+1
done
echo $cnt

results:
1
2
3
4
0

Comment 1 Jay Turner 1999-06-28 14:01:59 UTC
This issue has been forwarded to a developer for further action.

Comment 2 Cristian Gafton 1999-07-02 21:45:59 UTC
The example provided is invalid (is not a shell script)


Note You need to log in before you can comment on or make changes to this bug.