It's not a secret anymore!
The moose likes Linux / UNIX and the fly likes String comparison Shell script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "String comparison Shell script" Watch "String comparison Shell script" New topic

String comparison Shell script

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1400

if [ "$var1" == "test" ] then
echo "correct string"

./ gives syntax error at line 6: 'fi' unexpected. What is wrong ?

Sujoy Choudhury
Ranch Hand

Joined: Sep 17, 2008
Posts: 136

There was no ; after ]

Thanks and Regards,
I agree. Here's the link:
subject: String comparison Shell script
It's not a secret anymore!