Consultor Eletrônico



Kbase P133588: How to remove ^M from a source code after being transferred from Windows to UNIX
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/15/2008
Status: Unverified

GOAL:

How to remove ^M from a source code after being transferred from Windows to UNIX

GOAL:

Is there a way to convert files from DOS to UNIX format

FACT(s) (Environment):

UNIX
Windows

FIX:

The following commands can be used to strip the CR end of line characters:

tr -d '\r'

dos2unix

perl -e 's/\r//g'

To convert many files at once the following commands can be used:

perl -pi.bak -ne 's/\r//g' *.p *.w *.cls *.i

for i in *.p *.w *.cls *.i; do cp "$i" "$i".bak && tr -d '\r' <"$i".bak >"i"; done