0

I'm trying to remove the following special characters:

^M, ^[, ^G

from the script:

Script started on 2023-09-16 08:49:25-04:00 [TERM="xterm-256color" TTY="/dev/pts/1" COLUMNS="204" LINES="55"]
^[[?2004h^[]0;matt@SERENITY: ~/notes^G^[[01;32mmatt@SERENITY^[[00m:^[[01;34m~/notes^[[00m$ ls^M
^[[?2004l^Mcore_dump.md  hacking.md  hacking.md.backup  newfile  sep1623.md  signals.md  typescript  wifi.md^M
^[[?2004h^[]0;matt@SERENITY: ~/notes^G^[[01;32mmatt@SERENITY^[[00m:^[[01;34m~/notes^[[00m$ ls^M
^[[?2004l^Mcore_dump.md  hacking.md  hacking.md.backup  newfile  sep1623.md  signals.md  typescript  wifi.md^M
^[[?2004h^[]0;matt@SERENITY: ~/notes^G^[[01;32mmatt@SERENITY^[[00m:^[[01;34m~/notes^[[00m$ exit^M
^[[?2004l^Mexit^M

Script done on 2023-09-16 08:49:35-04:00 [COMMAND_EXIT_CODE="0"]

using the command:

:%s/^M|^G|^[

but it's not working, it just removes ^M and stops there. How do I write multiple patterns in one line and execute all?

Note - these are blue characters, that can be written via Ctrl-V and Ctrl-[character]

Mathew
  • 235

0 Answers0