移除換行控制碼^M

在不硬平台上面編輯過的檔案…
傳到Linux-like平台上面…
常常後面都會多出一個符號^M

其實無傷大雅還是可以用…(還沒遇到因為^M發生程式錯誤的狀況…)

但是一向要求完美的我…當下一定會手賤想要把他移除…

cat oldfile | tr -d ‘\r’ > newfile

搞定…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.