This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

String comparison Shell script  RSS feed

 
kri shan
Ranch Hand
Posts: 1487
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 136
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There was no ; after ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!