This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes if else in Script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "if else in Script" Watch "if else in Script" New topic
Author

if else in Script

Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1526


I have the above script, when i run it, i get

syntax error at line 4 : `else' unexpected

why?


Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Which shell are you using? For bash, I usually use:



JBoss In Action
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1526
Thanks i was on ksh.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: if else in Script
 
Similar Threads
get value on click from table using javascript
How to retain the value of drop down on click of browser back button
applet refresh event
jquery - ID dos not appere in --> getJSON
Search on a string