[clug] Cleaning up a "script" file
Kim Holburn
kim.holburn at gmail.com
Thu Mar 25 01:30:19 UTC 2021
https://superuser.com/questions/236930/how-to-clean-up-output-of-linux-script-command
On 2021/03/25 10:36 am, Brett Worth via linux wrote:
> Morning all.
>
> I use the "script" command to capture the output of sessions for reference and have been doing so for years. One thing that's always
> been a problem is that script just captures the literal stream of characters that's being sent out from the tty so all escape
> sequences appear in the output file.
>
> I've googled a bit and there's a lot of talk about using perl or sed to strip out the ^[[37m etc. sequences but I'm looking for
> something better.
>
> What would be very useful would be something that would interpret the controls. e.g.
>
> $ ls fred^H^H^H^Hbloggs
>
> would just display
>
> $ ls bloggs
>
> in the output file while perhaps just removing the colour selection commands. I use "vi" command line editing which always ends up
> looking like a dog's breakfast in the script output file.
>
> Does such a thing already exist? (before I waste time trying to do it myself)
>
> Brett
>
--
--
Kim Holburn
IT Network & Security Consultant
+61 404072753
mailto:kim at holburn.net aim://kimholburn
skype://kholburn - PGP Public Key on request
More information about the linux
mailing list