Updated Was: LFS 5.0 sed and tar Now : bad interpreter

Matthew Burgess matthew at linuxfromscratch.org
Sat Sep 18 13:44:07 PDT 2004

On Sun, 19 Sep 2004 08:35:10 +1200
Mark Carey <mark.carey at gmail.com> wrote:

> Ok so as Joel Miller pointed out, it appears that the window carrige
> return characters were confusing bash, the files were in dos format, a
> quick.
> vi configure
> :se ff=unix
> :wq
> allows the configure script to run
> fixed it all, am still getting some configure errors, possibly other
> programs effected, but will keep on working on it.
> Thanks for the help, now just got to figure out a fast way to change
> all files in a directory to unix format, there is a program that we
> comiple as part of LFS that can do this, xargs should also help.

yup, there's a couple of sed expressions you can use:

http://www.student.northpark.edu/pemente/sed/sed1line.txt gives

 sed 's/.$//'               # assumes that all lines end with CR/LF
 sed 's/^M$//'              # in bash/tcsh, press Ctrl-V then Ctrl-M
 sed 's/\x0D$//'            # gsed 3.02.80, but top script is easier

Out of those, I've found the top one to be too dangerous because of
the assumption mentioned - i.e. if you have _any_ unix file in the
same directory then it'll simply delete the last character on every

Hope this helps


More information about the lfs-support mailing list