There are a few different ways to convert a DOS file to Unix format, but the most available is probably this:
$ col -bx < dosfile > unixfile
colcommandsconvertdosfilterline-endingsnewlineshellunix
If you're using os.system to run a command (such as xterm running man) and you get "broken pipe" errors, you can restore standard pipe functionality with the signal module:
import signal signal.signal(signal.SIGPIPE, signal.SIG_DFL) # Call os.system after calling signal.signal.
Note: information taken from http://monkeyfingers.org/ (page now unavailable).
brokenlanguagesospipeprogrammingpythonsignalsystemunix
Given an array @slobber, replace all the CR-LF with CR:
foreach (@slobber) {
s/\015\012$/\n/; print;
}
dosforeachlanguagesline-endingsperlprogrammingsyntaxunix