• 1 Post
  • 7 Comments
Joined 2 years ago
cake
Cake day: July 4th, 2023

help-circle
  • Most of us can’t help but feel powerless while trying to change the world. That’s normal, because the reality is, no one can change the world as quickly as we can make a turn at the next junction. Not Donald Trump, not Elon Musk, not Vladimir Putin, not Xi JinPing. They’ve spent decades getting to where they are today, but the best they can do is do big strokes to sway the world to some extent. And these people just look so lonely; nobody seems to really understand them, neither do they seem to truly understand people, aside from knowing enough to take advantage of them, and they put up some sort of distance between themselves and others, distance in various ways you can measure. Meanwhile, most of us spend our times to be close to those we love and care, trying to be a part of a larger society in a healthy and responsible way.

    If the alternative is to give up and watch this beautiful world burn and die, watch wonderful people suffer and I turn a blind eye to their pain, I would rather continue trying, and one day die knowing that I tried, instead of regretting alone.




  • This is almost a strawman argument.

    You don’t have to shell out to a db cli. Most of them will gladly take some SQL and spit out some output. Now that output might be in some tabular format with some pretty borders around them that you have to deal with, if you are about the output within your script, but that’s your choice and so deal with it if it’s within your comfort zone to do so. Now if you don’t care about the output and just want it in some file, that’s pretty straightforward, and it’s not too different from just some cli that spits something out and you’ve redirected that output to a file.

    I’ve mentioned in another comment where if you need to accept input and use that for your queries, psql is absolutely not the tool to use. If you can’t do it properly in bash and tools, just don’t. That’s fine.

    With web API calls, same story really; you may not be all that concerned about the response. Calling a webhook? They’re designed to be a fire and forget, where we’re fine with losing failed connections. Some APIs don’t really follow strict rules with REST, and will gladly include an “ok” as a value in their response to tell you if a request was successful. If knowing that is important to the needs of the program, then, well, there you have it. Otherwise, there are still ways you can get the HTTP code and handle appropriately. If you need to do anything complex with the contents of the response, then you should probably look elsewhere.

    My entire post is not to say that “you can do everything in bash and you should”. My point is that there are many cases where bash seems like a good sufficient tool to get that simple job done, and it can do it more easily with less boilerplate than, say, Python or Ruby.