Hi,
I'm trying to send a log file to mailx as a "Body Message" but since the file contains so many control and color characters it's making an attachement out of it instead of putting it in the body.
The file looks like this:
HTML Code:
Bringing up loopback interface: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
19 Bringing up interface eth0: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
20 Starting portreserve: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
21 Starting system logger: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
22 Starting irqbalance: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
23 Starting rpcbind: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
24 Starting sssd: ^[[60G[^[[0;32m OK ^[[0;39m]^M^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
25 Starting RPC idmapd: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
26 Starting RPC gssd: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
27 Starting kdump:^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
28 Starting system message bus: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
29 Starting Avahi daemon... ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
30 Starting NFS statd: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
31 Initializing OpenCT smart card terminals: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
32 ^MŽ
33 Starting cups: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
34 Mounting other filesystems: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
35 Starting acpi daemon: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
36 Starting HAL daemon: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
37 Retrigger failed udev events^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
38 Starting PC/SC smart card daemon (pcscd): ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
39 Loading autofs4: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
40 Starting automount: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
41 Starting Hyper-V KVP daemon ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
42 Starting sshd: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
43 Starting xinetd: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
44 Starting ntpd: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
45 Starting postfix: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
46 Starting abrt daemon: ^[[60G[^[[0;32m OK ^[[0;39m]^M^MŽ
I've tried the following with no success.
cat boottest.log | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g"
I then did a dos2unix but this remains at the beginning
^[%G▸ ▸ Welcome to CentOS·Ž
2 Starting udev: ^[%G[ OK ]^MŽ
and even after the dos2unix one ^M remains in the file because it's in the middle of the text.
Don't take into account the line numbers, this is only my text editor setup.
Any help would be appreciated.