• Post Reply Bookmark Topic Watch Topic
  • New Topic

if else in Script  RSS feed

 
Akhilesh Trivedi
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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

syntax error at line 4 : `else' unexpected

why?
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which shell are you using? For bash, I usually use:

 
Akhilesh Trivedi
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks i was on ksh.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!