This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara 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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 5823
    
    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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: if else in Script