Subject: Re: sed question
From: [email-masked] (Heinz-Juergen Oertel)

13 Jan 1999 19:46:55 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
To: Doug Carter <[email-masked]>, [email-masked]

Doug Carter wrote:
> 
> Thanks for the tip, but you are going in the wrong direction. I
> want to go from unix to dos, which means I need to *add* a "\r"
> not delete one. How would tr work in that way?
> 
> Thanks,
> 
> Doug
> 
> Heinz-Juergen Oertel wrote:
> >
> > Doug Carter wrote:
> > >
> > > I'm having some trouble running a sed script with gun-win32.
> > >
> > > I have a script that converts text files from unix to dos:
> > >
> > > sed 's/$/^M/g' infile > outfile
> > >
> > > This command works fine on unix, but it doesn't work in dos.
> > >
> > > Can anyone enlighten me?
> > >
> > No, but it is simpler to use
> >
> > tr -d "\r" < infile > outfile
> >
> > but what is with umlauts ??
> > Oh i see, it's not your problem.
> >
> > Anyhow, does anybody ported recode ?
> >
> > > TIA,
> > >
> > > Doug Carter
> >

ok, it's not a job for tr.

sed 's/$/^M/' in > out

does it with 
bash 2.02.1(2)
sed 3.02
and a binary mounted file system w98
you need no g flag, it can be only one newline in a line

I'am not a sed guru,
always looking at the examples in 'UNIX Power Tools'

-- 
with best regards / mit freundlichen Grüßen

  Heinz-Jürgen Oertel
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".