1. 11
  1. 5

    I’ve said it before and I’ll say it again: if you’re having any difficulty writing it in shell you should probably use Perl or something even more robust.

    1. 3

      There is familiarity with a language and then there is right tool for the job. With experience, I lean towards the later, even if it means I have to spend time investigating what the right tool is. Using the right tool turns out to be efficient in the long run, generally. Exceptions being really trivial and simple tasks that can be accomplished in any familiar language, and won’t need enhancements.

      1. 3

        I have recently been getting a lot of value out of using xonsh for things like this. It’s about as convenient as writing things in bash, but also about as powerful as writing things in python. The main tradeoffs are that it’s slower than either, and you have to deal with python package and environment management, but for many one-off jobs I don’t care about those things very much.

        1. 1

          I feel like there’s a technology replacement curve effect here in which shell scripts are a very common first tool of implementation. It’s seductive for quick things until testing inevitably becomes a problem, and I say that having written a lot of bats testing code.