User login

line endings

Remove ^M from the end of all lines in a file that some fool edited with a Windows program

Where foo is the file that has the control Ms:

cat foo | col -b > foo2; mv foo2 foo

For instance, to take a likely Drupal example:

cat page.tpl.php | col -b > page.tpl.php.fixed; mv page.tpl.php.fixed page.tpl.php

Alternately, to do a bunch of files at once, use the *nix find command and the more convenient one-command dos2unix line ending changer via the tofrodos package.

Install the prerequisites first if you need to:
sudo apt-get install tofrodos

Syndicate content