[CentOS] How to test for '.' in a script

Owen Beckley OwenB at foxriver.com
Thu Jul 28 18:35:47 UTC 2011


> $ if [[ "$I" -eq '.' ]]; then echo true; fi
> -bash: [[: .: syntax error: operand expected (error token is ".")

-eq is for numbers

== is for strings

See "man bash".

-Owen




More information about the CentOS mailing list