You are not logged in.

#1 2008-12-01 07:17:10

MTsoul
Member
From: Vancouver, BC
Registered: 2008-08-14
Posts: 95
Website

Bash not accepting DOS line endings

Hi,

I'm trying to build the Boost C++ library. However, its configure scripts (hundreds of them) are filled with inane DOS line endings, and bash is not reading it correctly. It outputs things like "line 2: $'\r' command not found'. Is there a way to make bash accept it or ignore it?

Thanks in advance.

Offline

#2 2008-12-01 08:32:32

creslin
Member
Registered: 2008-10-04
Posts: 241

Re: Bash not accepting DOS line endings

You might try automatically converting the file with the 'dos2unix' tool from the 'hd2u' package.


ARCH|awesome3.0 powered by Pentium M 750 | 512MB DDR2-533 | Radeon X300 M
The journey is the reward.

Offline

#3 2008-12-01 15:44:43

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: Bash not accepting DOS line endings

or ...

cat dos-file | tr -d '\r' >unix-file

Offline

#4 2008-12-01 16:38:16

MTsoul
Member
From: Vancouver, BC
Registered: 2008-08-14
Posts: 95
Website

Re: Bash not accepting DOS line endings

Not practical. In a package of thousands of files, I do not know which are shell scripts, and there are hundreds of them...

Is there a way to make \r an alias of nothing? I tried doing it, but bash complains that \r is not a valid alias..

Offline

#5 2008-12-01 16:41:48

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: Bash not accepting DOS line endings

Sounds like you need to use some "find ... -exec sed ..." magic.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#6 2008-12-01 16:56:04

creslin
Member
Registered: 2008-10-04
Posts: 241

Re: Bash not accepting DOS line endings

What do some of these files look like?  I guess I'm just a little confused because the boost c++ sources that I'm looking at don't resemble what you're describing at all, so I'm not sure which boost c++ libs you're trying to build.  I guess you could do this:

$ find /path/to/source -type f -exec dos2unix {} \;

ARCH|awesome3.0 powered by Pentium M 750 | 512MB DDR2-533 | Radeon X300 M
The journey is the reward.

Offline

#7 2008-12-01 16:58:25

MTsoul
Member
From: Vancouver, BC
Registered: 2008-08-14
Posts: 95
Website

Re: Bash not accepting DOS line endings

It has C++ sources, but to build them into libraries, its configure scripts are shell scripts, and they are located across the library.

How well does that work ^? There are binaries in the package.

Offline

#8 2008-12-01 17:28:26

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: Bash not accepting DOS line endings

How about you simply modify the PKGBUILD? Why do you want to compile yourself in the first place?


1000

Offline

#9 2008-12-01 21:43:46

MTsoul
Member
From: Vancouver, BC
Registered: 2008-08-14
Posts: 95
Website

Re: Bash not accepting DOS line endings

I have some special needs for the binary.

Turns out they distribute Windows and Unix packages differently. I downloaded the .zip version, which is Windows even though they say it's cross-platform. Big d'oh! Thanks for all the help guys.

Offline

Board footer

Powered by FluxBB