wc -m in unix adds one character

前端 未结 1 1239
我在风中等你
我在风中等你 2021-01-27 05:02

Counting a line with 4 characters with no new line character:

ACTG

wc -m gives me 5. With echo, I can fix this problem so

相关标签:
1条回答
  • 2021-01-27 05:19

    As hexdump has shown you, whatever editor you are using is adding a '\n' or 0x0A (new line) character at the end of the line when you save the file, even if you aren't writing one explicitly.

    See: http://www.asciitable.com/

    0 讨论(0)
提交回复
热议问题