2016-04-02 33 views
0

我编写了这个脚本来自动创建HAML文件的副本,如果它不存在,或者它与旧的不同,并且处理两个脚本,但每当我想运行它时都会收到此错误。令牌“完成”附近的意外错误

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 

回答

3

第一行,替换:

while true do; 

有:

while true; do 
相关问题