For some reason cat
no longer shows line breaks when I use it, while all other tools (grep
, more
etc) do.
I am using iterm2 on OSX 10.11.4.
What could be causing this behaviour?
Example
I have a file test.txt
created in vim:
this is a test
this is a test
this is a test
When I do cat test.txt
the output is (note space in place of newline):
this is a test this is a test this is a test
Best Answer
These things can occur based on a whole bunch of small issues, either in the shell used, the terminal application used, the file format or something else altogether.
To triage, the following steps may be useful
cat -vet test.txt
to see whether there are additional characters in the file(echo a; echo b)|cat
to see if it depending on the input databash --noprofile
to see whether something is lurking in the shell configurationIn my case someone had modified 'cat' behaviour in .bashrc