Bug 299121
Summary: | "[ -n ${emptyvariable} ]" returns true | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jonathan Kamens <jik> |
Component: | coreutils | Assignee: | Pete Graner <pgraner> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | rawhide | CC: | twaugh |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2007-09-21 00:15:02 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
Jonathan Kamens
2007-09-20 19:42:01 UTC
Says Paul Jarc on bug-bash: "No, the final ] is always taken to be the match for [. Anything in between has to be parsed consistently with that. In this case, it means that the test expression includes only one argument, "-n". Since there is only one, it is taken to be an operand, even if it happens to have the same spelling as an operator. The operand is tested for being nonempty, which "-n" is, so the result here is true." |