2

Tried various existing answers, but didn't find any which entirely works. This is one line example, and show how it fails, maybe some extra switch or step can solve this?

This is the content of file I am trying to save to txt file with control characters applied before making to disk: fooo^H^H^H^Hbarr^H^H^H^H ^H^H^H^Hok

Best tool found til now is col -b but here is example where is fails. I have tried:cat mem.txt | col -b > mem2.txt but result is okrr I don't know why it ignores those 4 spaces which should clean barr but it does.

Source problem is that I am trying to redirect clean log from /usr/bin/time -f'%E' sudo memtester 2M 1 to file on disk but I am unable to clean it from junk from progress prints. This is only one program giving me this problems, I have several more so if this one has some mode not to print progress it will probably not solve my headaches.

EDIT This sed works for memtester case, but not in general, so for now best solution is:

| sed -re ':b; s,[^\x08]\x08,,g; tb' | col -b >

0 Answers0