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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 1365

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,
It is sorta covered in the JavaRanch Style Guide.
subject: String comparison Shell script
Similar Threads
passing reference problem.......I think :confused:
Certification cx 310-035
JUnit testing
difference between ./sh and . ./