A new addition to my .bashrc, a bash function that will swap Macintosh newlines for UNIX ones:
function mac2unix()
{
sed 's/\r/\n/gi'
}
To use it, pipe it as so:
cat file.txt.bad-newlines | mac2unix > file.txtThis will convert Macintosh newlines from files that Mac friends forgot to upload in ASCII mode. If this is not done, programs will ignore the Macintosh newlines and files will have no newlines, which goes without saying is very annoying.
Recent comments
41 weeks 1 day ago
41 weeks 5 days ago
41 weeks 6 days ago
42 weeks 3 days ago
44 weeks 4 days ago
44 weeks 4 days ago
44 weeks 4 days ago
45 weeks 1 hour ago
45 weeks 3 hours ago
45 weeks 3 hours ago