in reply to Why do I sometimes get null characters after the line feed when writing to files?
(Note that the first one is length three, but od displays a fourth null byte.)$ echo "ab" > /tmp/foo $ ls -l /tmp/foo -rw-r--r-- 1 davem davem 3 Dec 18 16:16 /tmp/foo $ od -xc /tmp/foo 0000000 6261 000a a b \n \0 0000003 $ echo "abc" > /tmp/foo $ ls -l /tmp/foo -rw-r--r-- 1 davem davem 4 Dec 18 16:17 /tmp/foo $ od -xc /tmp/foo 0000000 6261 0a63 a b c \n 0000004 $
Dave.
|
|---|