Difference between revisions of "Một số lỗi hay gặp trên Linux/Ubuntu"

From CodeForLife
Jump to: navigation, search
(Created page with " __TOC__ == '''Lỗi: "./configure : /bin/sh^M : bad interpreter [duplicate]"''' == Lỗi này hay gặp khi bạn chạy một tệp shell script, mà tệp này được s...")
(No difference)

Revision as of 16:07, 15 June 2018

Lỗi: "./configure : /bin/sh^M : bad interpreter [duplicate]"

Lỗi này hay gặp khi bạn chạy một tệp shell script, mà tệp này được soạn thảo trên Windows và dưa lên Linux để chạy. Lỗi này do khi soạn thảo trên Windows sử dụng cụm kí tự "\r\n" để xác định xuống dòng trong khi Linux chỉ sử dụng kí tự "\n". Chi tiết xem: https://stackoverflow.com/questions/2920416/configure-bin-shm-bad-interpreter

Để sửa lỗi này,  mở tệp shell script bằng vi hoặc vim, sang chế độ dòng lệnh (Command mode) đánh lệnh sau:
:set fileformat=unix
Cuối cùng, đánh lệnh:x! hoặc :wq! để lưu vào thoát khỏi ứng dụng vi/vim