is there any way to convert bash output to html ? for example if I had some colorized output in bash ( something like htop ), how can I convert it to html tags ... ( somethi
1.) check that ansifilter
and script
programs are installed
2.) script -c 'ansible-playbook -i /tmp/or/some /tmp/other/command.yml' -O /tmp/myTypescriptOutput.file
(script
writes the output of a command to a file in typescript notation)
3.) convert to html, e.g. to view with your browser:
ansifilter -i /tmp/myTypescriptOutput.file -H -o output.html
convert to rtf, e.g. to view with libreoffice or word
ansifilter -i /tmp/myTypescriptOutput.file -R -o output.rtf
see man ansifilter
for other options (latex, tex, svg, pangot, txt, ...)
(additional, if highlight
is installed:
highlight /tmp/myTypescriptOutput.file --force
... this will print the saved-shell output in color, like if it was executed at first time)