看板 Linux 關於我們 聯絡資訊
請問一下 dos2unix 出現現面的訊息 "Skipping binary file" 但是我檔案是 .c & .h file 不是 binary file 請問怎麼會這樣? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 112.104.90.226
shemale:你是不是程式中有中文字? 03/17 00:10
shemale:可以用這命令:tr -d '\r' < abc.c > abc.c.new 03/17 00:10
shemale:這就相當於dos2unix,不過這命令只能在linux做 03/17 00:11
shihyu:no... code & commit 都是英文 03/17 00:26
shemale:那就奇怪了,還是你存成utf8格式?MS會在前面放三個bytes 03/17 01:14
shemale:如果是在windows下,用notepad看,或存成ANSI不可是UTF-8 03/17 01:16
shihyu:sed -i'' "s/\r//" `find . -type f -iname "*.[ch]"` 03/17 02:28
shihyu:上面這招就搞定了 03/17 02:28