commandline
Automating the handling of bank and financial statements
sterilize-ng: a command-line URL sterilizer
Splitting a string on the command line - the search for the one-liner
It seems like the command line is one of those places where you can accomplish crazy efficient things with one-liners. Here’s a perfect use case for a CLI one-liner: In Anki, I often add lists of synonyms and antonyms to my vocabulary cards, but I like them formatted as a bulleted list. My usual route to that involves Markdown. But how to convert this: известный, точный, определённый, достоверный to
известный
-точный
-определённый
-достоверный
After trying to come up with a single text replacement strategy to make this work, the best I could do was this:
sed matching whitespace on macOS
sed is such a useful pattern-matching and substitution tool for work on the command line. But there’s a little quirk on macOS that will trip you up. It tripped me up. On most platforms, \s is the character class for whitespace. It’s ubiquitous in regexes. But on macOS, it doesn’t work. In fact, it silently fails. Consider this bash one-liner which looks like it should work but doesn’t: