[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"unset" return value wrong
From: |
Stephen Gildea |
Subject: |
"unset" return value wrong |
Date: |
Fri, 13 Oct 2000 19:14:16 EDT |
The exit status of the "unset" shell built-in should be 0 if given any
unsettable variable, whether or not the variable needed to be unset.
In bash 2.04, unset returns 1 if the variable wasn't set to begin with.
This isn't the correct criterion according to Posix, and it broke a
shell script of mine that didn't expect that behavior.
Furthermore, "help unset" claims that PATH and IFS cannot be unset.
After reading that, I would expect "unset PATH" to not unset PATH and
to return 1. Instead it does unset PATH and returns 0.
< Stephen
- "unset" return value wrong,
Stephen Gildea <=