Nikola Stojaković
Nikola Stojaković

Reputation: 2305

Unexpected error near token 'done'

I wrote this script to automatically make copy of HAML file if it doesn't exist or if it's different than the older one and process two scripts but I get this error whenever I want to run it.

while true do;

    if [ ! -f index_copy.haml ]; then

        echo "\e[33mCreating 'index_copy.haml' file."
        cp index.haml index_copy.haml

        if [ $? -eq 0 ]; then
            echo "\e[36mDone."
        else
            echo "\e[32mError!"
        fi

    fi

    if cmp -s "index.haml" "index_copy.haml" ; then

        cp index.haml index_copy.haml
        echo -e "\e[34mProcessing HAML...\n"
        haml index.haml index.html 
        cd css
        echo -e "\e[32mProcessing SCSS...\n"
        sass style.scss style.css
        cd ..
        echo -e "\e[36mDone."

    fi

done

Upvotes: 0

Views: 24

Answers (1)

SLePort
SLePort

Reputation: 15461

First line, replace :

while true do;

with :

while true; do

Upvotes: 3

Related Questions