Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compare a character 1

Status
Not open for further replies.

Yarka

Technical User
Jan 14, 2007
192
ES
hi,
In bash script, I need to take out of a character of a string. For this reason, I do:
a=${a:3:1}
After, I need to compare it with a character :. For this reason, I do:
if [$a == ":"]; then ....
but, when I run my script, on my output is:
unary operator expected

How can I compare it?
Txs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top