Ever wanted to pipe “tail -f” to a web-page? Here’s a one liner… On the server$ (echo -e ‘HTTP/1.1 200 OK\nAccess-Control-Allow-Origin: *\nContent-type: text/event-stream\n’ && tail -f /path/to/some/file | sed -u -e ‘s/^/data: /;s/$/\n/’) | nc -l 1234That should all be on a single line. Note: This is for the GNU version of Sed, typically found in Linux distros. If using the BSD version of Sed (e.g
![tail -f to the web-browser](https://cdn-ak-scissors.b.st-hatena.com/image/square/01c56dc0649c8e70c5b9db060dcd1c49222bd691/height=288;version=1;width=512/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afit%3A1200%2F1%2A88OzGL0st4kFLlBzX7ov4g.png)