Skip to content

Instantly share code, notes, and snippets.

@navitux
Created August 3, 2022 01:18
Show Gist options
  • Save navitux/701164d268ad173f9ccd8a332a528c8c to your computer and use it in GitHub Desktop.
Save navitux/701164d268ad173f9ccd8a332a528c8c to your computer and use it in GitHub Desktop.
Clean manually the output of script command of non-visible or undesirable characters
sed -f filters.sed nasty-script > clean
s/.?//g
s/K?//g
s/K?2004h//g
s/[^[:print:]\t]//g
s/\[0m//g
s/\[1m//g
s/\[22m//g
s/\[24m//g
s/\[27m//g
s/\[31m//g
s/\[32m//g
s/\[39m//g
s/\[7m%//g
s/\[7m16//g
s/\[?//g
s/\[?2004l//g
s/\[J//g
s/\[K\[?2004h//g
s/\[K\[?2004ht//g
s/\[K\[?2004hu//g
s/ccal/cal/g
s/ddu/du/g
s/eecho/echo/g
s/eexit/exit/g
s/ttldr/tldr/g
s/uuptime/uptime/g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment