txt files in windows won't work in linux

Erika Pacholleck pchllck at nexgo.de
Sat Nov 30 23:45:57 PST 2002


[01.12.2002] john smith <-- :
> "James Drabb" <JDrabb at tampabay.rr.com> wrote in message
> > "john smith" <no at thanks.com> wrote:
> >
> > > I have tried this and although the script files look normal from cat
> > > they never work complaining about "command not found" and other errors
> > > like that.
> >
> > This is because they are in windows cr/lf format.  You can either use a
> > good windows editor like textpad and save in unix format or you need to
> > convert them on Linux.  To convert them you can use vim like so:
> >
> > 1.  Open the file in vim
> > 2.  Press :
> > 3.  Type set ff=unix <enter>
> > 4.  Press :
> > 5.  Type wq <enter>
> > 6.  Repeat as needed.
> >
> Anyone know if there is a way to get sed to stip out these characters

Same way as you would do it in vim:

" substitute line in vim:
:% s/^M//g

# sed line
sed -e 's/^M//g' file >file.sedded

You produce the ^M by holding down CTRL and then hit v and m.
-- 
Erika ...---...: pacholleck at nexgo dot de
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-support' in the subject header of the message



More information about the blfs-support mailing list