Find the answer to your Linux question:
Results 1 to 2 of 2
hi i am a newbie in bash scripting i wrote a 5 line code and am getting an error as follows: "syntax error near unexpected token done" heres the code ...
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    2

    syntax error near unexpected token done

    hi i am a newbie in bash scripting i wrote a 5 line code and am getting an error as follows:

    "syntax error near unexpected token done"

    heres the code

    Code:
    for i in *.sh; do 
    if test ”./$i” != ”$0”; then 
    tail -n 5 $0 | cat >> $i ; 
    fi
    done
    also on reading tutorials from different sites i found that some use a semicolon after each statement while some dont ??

    please help

    thnks in advance

  2. #2
    Just Joined!
    Join Date
    Dec 2009
    Posts
    8
    you only need a semicolon to seperate statements on the same line

Posting Permissions

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