dos2unix alternative on your Mac


Right, just a really quick post – nevertheless it is a very useful one! You know when you are building code and end up with really annoying Control+M characters in files that you created using Windows … Yeah those ones!

This is how to fix them on your Mac

$ cat foo | col -b > foo2

Where foo is the file that has the Control+M characters at the end of the line, and foo2 the new file you are creating!

Enjoy!

2 Comments

Filed under English, Mac, Solaris

2 Responses to dos2unix alternative on your Mac

  1. Great Post, you saved my day!
    Thx!

  2. Talbott Jones

    I used this command a few weeks ago with great success. Today it only generates an empty file. I’ve done some cleanup on my Mac, but I don’t know of anything that would make this command stop working. It must be a user error, but what?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s