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

Bookmark this!

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • del.icio.us
  • Digg
  • Fark
  • Furl
  • MisterWong
  • NewsVine
  • Reddit
  • Spurl
  • StumbleUpon
  • TailRank
  • Technorati

Submit your comment

vision22.net

Copyright © 2007