"od" wrong line endings and byte count
David Christensen
dpchrist@holgerdanske.com
Sun Jan 2 20:14:00 GMT 2005
cygwin:
When I create a file using notepad:
This is a text file created with Notepad.
It has DOS (CRLF) line endings.
Look at it using "wc":
dpchrist@p42800e:~$ wc textfile.txt
2 14 76 textfile.txt
And then look at it with Cygwin "od", I see:
dpchrist@p42800e:~$ od -Ad -tc textfile.txt
0000000 T h i s i s a t e x t f
0000016 i l e c r e a t e d w i t h
0000032 N o t e p a d . \n I t h a s
0000048 D O S ( C R L F ) l i n e
0000064 e n d i n g s . \n
0000074
Note the incorrect line endings ("\n") and byte count (74).
When I look at the same file using "od" from
http://unxutils.sourceforge.net/, I see:
dpchrist@p42800e:~$ od-unxutils -Ad -tc textfile.txt
0000000 T h i s i s a t e x t f
0000016 i l e c r e a t e d w i t h
0000032 N o t e p a d . \r \n I t h a
0000048 s D O S ( C R L F ) l i n
0000064 e e n d i n g s . \r \n
0000076
Note the correct line endings ("\r \n") and byte count.
David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 16159 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050102/903421b3/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: textfile.txt
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050102/903421b3/attachment.txt>
-------------- next part --------------
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list