From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Firefox/0.10 Description of problem: bash incorrectly returns a false boolean value when comparing two long integers (YYYYMMDDHHMMSS), specifically: if [ 20041021183908 -gt 20041021183406 ] returns false when it should return true Version-Release number of selected component (if applicable): bash-2.05-8.2 How reproducible: Always Steps to Reproduce: Create a script: #!/bin/bash v1=20041021183908 v2=20041021183406 if [ $v1 -gt $v2 ] then echo "$v1 is greater than $v2" else echo "$v1 is less than $v2" fi Run it! Actual Results: Output of script reads 20041021183908 is less than 20041021183406 Which is incorrect. Expected Results: It should read: 20041021183908 is greater than 20041021183406 Additional info: Works fine on RHE3 (bash-2.05b-29.0.3)
The obvious work-around is to use the ">" operator, which we're doing right now.
Created attachment 105601 [details] Reproduction of gt bug
Created attachment 105602 [details] Reproduction of gt bug Reproduction script
Fixed in newer versions of bash. Closing.