Is there a way to interpret/"execute" backspaces in a file/line using common bash commands? I have a console program which prints some stuff and than erases it using backspaces and finally writes the end result. What I actually want is the output at the end.
echo -e "Foo\b\b\bBar" | what_goes_here > test.log
My test.log should only contain "Bar". I guess a problem to do this is how much text should be buffered until considered as really printed... In my case a "line buffered" interpreter would be sufficient.
Most utility have a switch which do not print such characters in first place. But the utility at hand has no such switch...
echo -e "Foo\b\b\bBar" > test.log
works for me to have onlyBar
in test.log. Can you elaborate why this does not work for you?od -c < test.log
^H
hexdump -C test.log
)