Suppose you are working on a very old unix server where
sed are not present. How can you convert files from dos to unix format?
A server without
sed would have to be really old, or missing some basic commands. Hopefully
ed is there; it existed in Unix first edition.
ed /path/to/file 1,$s/^V^M$// w q
^V^M means typing Ctrl+V then Ctrl+M (to enter a literal line feed). If you know that all lines do end in CR LF, you can use
1,$s/.$// instead (indiscriminately remove the last character on each line).