- To: SLUG user group <slug@xxxxxxxxxxx>
- Subject: [SLUG] Re: Unix >< DOS text converter
- From: Angus Lees <gusl@xxxxxxxxxxxxxxx>
- Date: Sat Aug 18 23:25:02 2001
- User-agent: Mutt/1.2.5i
\begin{Jamie Wilkinson}
> >can anyone recommend a text file converter running on Windows, that converts
> >DOS into Linux/UNIX and vice versa?
> something like sed 's/\r\n/\n/' but last time I checked, sed doesn't support
> newline characters in regexs.
that's because \n is called $ in sed (line-based) speak ;)
sed 's/\r$//'
i'm not sure sed allows \r escapes.. you might want to try:
sed s/`echo -ne \\r`'$//'
but then that just depends on your version of echo ..
the gnu version does actually support newlines, you just have to
actually include a real life newline character:
Miscellaneous notes
This version of sed supports a \<newline> sequence in all
regular expressions, the replacement part of a substitute
(s) command, and in the source and dest parts of a
transliterate (y) command. The \ is stripped, and the
newline is kept.
--
- Gus