The VI text editor is a very flexible text editor. This can read from STDIN, and this makes it very good to use in a script. But you can also read a file from the Internet. This works in concert with the wget utility.
The wget -O- -q
command reads a file from the Internet and prints it to STDOUT. Then the vi -
command reads the file into the text editor.
4.4 Fri Apr 10 jason@Yog-Sothoth 1: $ wget -O- -q http://i.mjh.nz/au/Perth/kodi-tv.m3u8 | vi - Vim: Reading from stdin... |
This works very well indeed. Use the :q!
VIM command to exit. The :w playlist.txt
VIM command will write a copy of the file into the playlist.txt file.