How to remove ˆM chars?

Posted by LucaB on Stack Overflow See other posts from Stack Overflow or by LucaB
Published on 2010-06-09T13:10:36Z Indexed on 2010/06/09 13:22 UTC
Read the original article Hit count: 524

Filed under:
|
|

I have a file generated from windows that I have to paste into a script under linux. My script works fine, except for the fact that at the end of every line I got a ^M char.

How can I remove it with bash?

Currently my script is:

#/bin/bash
IFS=$'\n'
for CUSTOMER in `cat exp.csv`
do
    echo $CUSTOMER
done

© Stack Overflow or respective owner

Related posts about Windows

Related posts about bash