Does anyone know what this means?
sed -e 's/\r$//' inputfile > outputfile
This is what I have so far:
\r refers to Carriage Return (CR)
so possibly Swap the blanks for Return Carriage? in the inputfile? I'm not too sure really
It's changing files from CRLF-terminated lines into LF-terminated lines. The former tend to be Windows-type files where each line ends with a carriage-return/linefeed (CRLF or \r\n).
UNIX-type files just have a newline character (LF or \n).
Specifically, that sed command substitutes \r at the end of a line (indicated by $) with nothing, the same as s/xyzzy/plugh/ would change the first xyzzy in the line into plugh.
sed is the name of the program you call.
-e tells sed that the following argument is the expression to run.
s/\r$// is a substitution: it tells sed to replace carriage return at the end of line ($) with nothing. Sed does that for each line.
inputfile is the file from which sed reads its input.
> is a redirection operator, it means the output of sed will be redirected to outputfile.
Basically, the result should be the same as dos2unix (sometimes renamed to fromdos).
$) with a carriage return (\r). See unix2dos or todos for alternatives.