bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unset does not work as expected in functions.


From: Chet Ramey
Subject: Re: unset does not work as expected in functions.
Date: Tue, 20 Jan 2004 17:13:23 -0500

> Machine Type: i686-pc-linux-gnu
> 
> Bash Version: 2.05b
> Patch Level: 0
> Release Status: release
> 
> Description:
> 
> When you unset a variable declared as an integer (declare -i), inside a 
> function, then try to reuse it as a text variable, it continues to act 
> like and integer (assigning a string to it results in 0 being stored).

It's a bug.  The unset code attempts to retain the `local' attribute, so
the variable remains local if declared again later in the function, but
needs to unset the other attributes when doing so.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    address@hidden    http://tiswww.tis.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]