Windows on the Mac
awk 'sub("$", "\r")' < readme > readme.txt
This is the old "Windows text file on a Unix box" trick. Which ironically, uses awk (which predates Windows) to convert a text file with Unix line feeds to something friendlier for Windows. (Note that the inverse is tr -d '\15\32' which is what I am most accustomed to from decades of unix, but alas tr doesn't go both ways)
All this comes to mind because I recently captured some output from MySQL via my OSX terminal, and prepared a text file to send to somebody. The recipient was one of the unwashed Windows masses, who complained about the linefeeds ("It doesn't look right" he whines).
I have Parallels, so I drag and drop the text file into a Parallels shared folder I have set up between Parallels and OSX. In one (Terminal) window I fix the file, in the other (Parallels) window I double click on the file to make sure it renders correctly in the Windows world. I feel very elegant and regal doing this--even though I'm actually using Windows--which is something I'm trying to swear off, but feel somewhat justified about because it's happening in a virtual machine. Kind of like how I enjoy the sharp blues of 3270--but only in an emulator.
As an aside, I finally found something that doesn't run on Parallels. Some of our own (from a third party vendor) applications crash when attempting to run within the VM (I suspect they'd fail in any VM context). They're probably making assumptions about video drivers or using some long deprecated Win32 calls? Even the equivalent "Web Client" fails because it's really just a thin wrapper for a big fat CAB file that uses the same poorly behaved code (He says while shaking his fist in the general direction of Redmond).