Find the answer to your Linux question:
Results 1 to 4 of 4
I am getting this error line 47: syntax error near unexpected token `else' line 47: ` else ' I would post my code but it seems I am not allowed ...
  1. #1
    Just Joined!
    Join Date
    May 2009
    Posts
    8

    What does this error mean

    I am getting this error
    line 47: syntax error near unexpected token `else'
    line 47: ` else '
    I would post my code but it seems I am not allowed to do to the fact it is a school assignment if the admins allow I will post code later on
    If not could anyone explain possible remedies for this.
    ty for any help in advance

  2. #2
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    It simply means the compiler found something near else that's out context...

    The error message is displaying `else', do you have a ' or ` in your code that doesn't belong...

    Note one is a single quote and the other is a back tick

    ...Gerard4143
    Make mine Arch Linux

  3. #3
    Just Joined!
    Join Date
    May 2009
    Posts
    8
    Im sorry what do you mean for i have an `or" because Im pretty sure I dont I am using an or in an if condition but in the form of -o for example
    if [ $user_choice = "T" -o $user_choice = "t" ]
    then
    but im sure this is fine the way i have done it

  4. #4
    Just Joined!
    Join Date
    Nov 2008
    Posts
    25
    perhaps the compiler can't find a matching if to the else? Perhaps a misplaced accolade?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...