Monday, November 2, 2009

Bash Numeric Comparison

Do not use > or < when comparing numbers in BASH. It doesn't work. It tries to redirect output instead of performing the comparison. Use -lt or -gt instead.

Additional Reading:

http://fvue.nl/wiki/Bash:_Numeric_comparison

http://tldp.org/LDP/abs/html/

No comments:

Post a Comment