delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/01/13/19:46:55

From: oe AT port DOT de (Heinz-Juergen Oertel)
Subject: Re: sed question
13 Jan 1999 19:46:55 -0800 :
Message-ID: <369CA051.1986B20E.cygnus.gnu-win32@port.de>
References: <369A2BFC DOT C2EC3451 AT WebCriteria DOT com>
Mime-Version: 1.0
To: Doug Carter <doug AT webcriteria DOT com>, gnu-win32 AT cygnus DOT com

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
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019