Posted: . At: 9:39 AM. This was 4 years ago. Post ID: 14240
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Read a file from the Internet directly into VIM.


Scary Windows picture.
Scary Windows picture.

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.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.