Re: How to test for '.' in a script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> $ 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

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux