My Lights Run on Bash – Tomasz Kramkowski

(kramkow.ski)

24 points | by todsacerdoti 5 hours ago

3 comments

  • Rediscover 1 hour ago
    It's time for me to re-read the man page for bash. I was not aware of BASH_REMATCH, wow. It's in the first snippet on the linked page, and would save the hassle of using multiple var expansions of the %% and ## et al sort.
    • tecleandor 55 minutes ago
      Oh yeah! I was unaware too! Nowadays I quickly jump to python instead of using Bash even for the simplest of scripts , but this could help creating tiny and easy to understand scripts for some integrations...
      • enriquto 15 minutes ago
        > I quickly jump to python instead of using Bash even for the simplest of scripts

        You don't seem to respect the old, venerable, well-tested adage: "once your shell script becomes too complex, switch to a real programming language like python".

        Or, the zen version (formally equivalent, but with quite a different tone): "once your program becomes sufficiently simple, turn it into a beautiful shell script".

  • sunshine-o 46 minutes ago
    MQTT is a fantastic protocol.

    I basically do the same as the author but use nutshell and its powerful pattern matching [0] as the router

    -[0] https://www.nushell.sh/cookbook/pattern_matching.html#patter...

  • sunshine-o 42 minutes ago
    For those using termux, termux widgets are exposed to Android device control so you don't need the MqttDroid app