Hacker News new | ask | show | jobs
by e12e 2909 days ago
My first thought was "this seems neat", and my second thought was: how hard would it be to write a small js script to play back "script"[s] output? Or, to take script output, convert it to some pre-tags and add js animation on top of that...

I suppose the main barrier would be lack of recorded timing information in script logs, so either pre-procesding or pause for input (say 50ms/keystroke + 200ms pr return/line-feed) and/or output (say 50ms pr line feed).

Although, now I see there's a -t option for a timing file.

So would seem one should be able to take logs from script, and produce svg, gif, png, webm, mp4... js output.

[s] http://man7.org/linux/man-pages/man1/script.1.html

2 comments

I did that in another way: write a demo script, and make it execute in another terminal. Snippet on GitLab [1].

Simply call it with "shell-demo DEMO_SCRIPT", and follow the instructions.

Demo scripts examples are given aside the snippet.

[1]: https://gitlab.com/snippets/1730340

the timing information you want is what 'ttyrec' is for http://derpi.tuwien.ac.at/cgi-bin/man/man2html?1+ttyrec