3 ms·
There's an error in line 1024. The transform strings are not the same length. I'd like to see more sed programs on HN instead of the usual Python, Ruby or Go
by gwu78 13y ago
There's an error in line 1024. The transform strings are not the same length.
I'd like to see more sed programs on HN instead of the usual Python, Ruby or Go offerings.
I wrote a sed version of the the Python script "youtube-dl". This way I don't need Python installed to download YouTube videos. And it's easy to edit if YouTube suddenly changes their "API"; no need to wait for someone else to fix their Python or Lua script. In truth, it's not pure sed though. It uses sh (not bash), sed and ftp (or any other http client that handles 302's).
- mkohlmyr 13y agoAre you frequently on a unix platform without python? Just out of interest. I agree its nice to see a variety of languages. Gives a fresh perspective on how to do things.
- gwu78 13y agoYes. I never need to install Python permanently.[1] In my experience, there is almost always a way to do what needs to be done with what UNIX provides, without installing more software. This keeps the system smaller, more standardized and hence more portable than one where various dependencies are haphazardly added. 1. Sometimes I have to install it temporarily, for "reverse engineering" a non-Python solution, e.g., when someone decides to use Python as a substitute for make.
- retr0h 13y agoYa totally! I still telnet to my servers... Don't want to fill my system with extra software. :P
- gwu78 13y agoNot sure I understand your comment. Like sed, all UNIX systems provide ssh. It's not "extra software". There's no need to use telnet. On the other hand, not all UNIX systems have Python pre-installed. Moreover, as in the case of embedded products, not all systems may have the space for it.
- ibizaman 13y agoNeither do I
- testtest12345 13y agoYou have to use Unicode sed.
- gwu78 13y agoAh. Thanks. I just assumed a strictly POSIX sed would work. My mistake.
- andrewcooke 13y agoeither it's fixed or you are having unicode issues. looks fine to me.