Change Windows type line endings to Mac
To convert files from windows (or DOS) type line endings to UNIX or Mac flavor use “flip”
Convert DOS or Windows line endings to Unix or Mac
flip -d <filename>
Convert Unix line endings to Windows
flip -u <filename>
To install flip on Mac:
sudo port install flip
To install flip on Ubuntu Linux
sudo apt-get install flip
How do you know your line endings are DOS or Windows flavor? Open your text file with a plain text editor. If you see a “^M” at the end of every line then your line endings are DOS/Windows.
From the flip Usage instructions
Usage: flip [-t|-u|-d|-m] filename[s]
Converts ASCII files between Unix, MS-DOS/Windows, or Macintosh newline formats
Options:
-u = convert file(s) to Unix newline format (newline)
-d = convert file(s) to MS-DOS/Windows newline format (linefeed + newline)
-m = convert file(s) to Macintosh newline format (linefeed)
-t = display current file type, no file modificationsRecent blog posts
- Amazon S3 Website CNAME
- Button labels for checkout
- Insert html django contrib messages
- Twitter Bootstrap not working with LESS.js
- Javascript libs that offer basic subset of jquery features
- Building the donor-matic
- Playing with free Google Map alternatives.
- Some flows are not as complicated as they appear
- Form design crib sheet
- Script to get IE9 Windows Virtual PC images into Virtual Box