Thursday, February 3, 2011

Remove ^M

Sometimes window's guru edited oracle tnsnames.ora file and left there some brilliant artefacts:


  (DESCRIPTION =^M
    (ADDRESS_LIST =^M
      (ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.1)(PORT = 1521))^M
    )^M
    (CONNECT_DATA =^M


Remove ^M:

to remove ^M, give the command :
sed -e 's/^M//g' file
first press control-V then control-M

or the same in vi: :%s/control-Vcontrol-M//

this will show correct control-M in sed's command line.

Have a nice day Unix user:)

No comments:

Post a Comment