File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "String comparison Shell script" Watch "String comparison Shell script" New topic
Author

String comparison Shell script

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1368
sample.sh
----------
#!/bin/ksh

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

./sample.sh 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,
~Sujoy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String comparison Shell script
 
Similar Threads
JUnit testing
precedence
passing reference problem.......I think :confused:
Certification cx 310-035
difference between ./sh and . ./sample.sh