Vi on Linux: show ^M line endings for DOS-format files
- by sss
On Solaris, if you open a file in vi that has Windows line endings, this shows up as ^M at the end of every line.
On Linux, vi is cleverer and understands the Windows file format, and does not display ^M.
Is there a setting to make Linux vi behave the same as Solaris in this respect?
A common problem for us is copying a shell script off a (Windows) dev box and forgetting to dos2unix it, and then being confused when it doesn't work properly. On Solaris the problem is obvious as soon as you vi the file, but not on Linux.
Thanks.