1. 程式人生 > >執行linuyx shell 出現syntax error: end of file unexpected (expecting "done")

執行linuyx shell 出現syntax error: end of file unexpected (expecting "done")

linux 下 出現此種錯誤 有可能有以下幾種原因: 1。換行符問題      沒有使用unix換行符      解決辦法:1) 可以在window下用ue改成unix換行符                        2)vi   dos.txt                                       :set fileformat=unix
                             :w                           dos換行符會在行後出現^M                           刪除即可。
                         或在vi裡用                                   :1, $ s/^M//                                   替換掉^M
                         或vi 編輯器下直接 :set nu