File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Android Security Essentials Live Lessons this week in the Android 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: 1371

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
difference between ./sh and . ./
JUnit testing
Certification cx 310-035
passing reference problem.......I think :confused: