Convert dos linebreaks without dos2unix available
- October 18th, 2007
- linux
Sometimes its necessary to convert files that are written by a windows software, when they are supposed to run in linux. These files usually include a "\n\r" sequence at the end of a line. In linux only "\n" is expected. Usually there is dos2unix available for such purposes, but sometimes it's just missing. Then tr (truncate) comes to a rescue.
cat filename | tr -d "\r"> filename.new ; mv filename.new filename
















Submit your comment