Script string removal

0

To edit this file and remove all incidence of ^ [[* m how do I edit thirst? Incidents are marked in bold.

  

sed 's / \ ^ [[* m // g' file

The backup routine is still running on the server!

The backup process began at 15:19:28 EDT and is currently on account **^[[1;33m0^[[0;00m** out of **^[[1;33m5** **^[[97m(0%)^[[0;00m**

Time since backups started: 00:00:05

Currently there are **^[[1;33m0^[[0;00m** accounts being excluded from backups.
To watch the log, use this command: **^[[97m**tail -f /usr/local/cpanel/logs/cpbackup/1497899968.log**^[[0;00m**

To check for backup duration history run: ^[[1;32m bash <(curl -ks scriptorigem) ^[[0;00m
    
asked by anonymous 20.06.2017 / 00:43

2 answers

2

Apparently, the occurrences you want to filter out are ANSI escape sequences .

In this case, you can use a utility called ansifilter to solve your problem:

$ ansifilter -i entrada.txt -o saida.txt

Alternatively you can use the sed utility to remove \x1b escape sequences:

$ sed 's/\x1b//g' entrada.txt
    
20.06.2017 / 16:45
1

With a sed only command, you can remove all escape sequences from the terminal as follows:

sed 's/\^\[\[[^m]\+m//g' <seu_arquivo>

In sed, characters that have meaning in Regular Expressions must be escaped ( ^ , [ and + ).

    
28.06.2017 / 23:45