Comes up all the time when people ask how to do things in bash/sh. I know there are better tools for the job, but this is the one I have.
Comes up all the time when people ask how to do things in bash/sh. I know there are better tools for the job, but this is the one I have.
And then to ice the cake you find the question because your question has been marked as a duplicate of the older question where they answered using unix binary tools… and you specifically asked about doing something in “pure shell script” or something similar to that phrase.
Stack overflow is fundamentally a system design that breaks down at scale due to misalignment of incentives that are necessary for it to work well at smaller scales (as can be seen in the successful operation of various smaller Stack Exchange sites for various topics such as Law, Aviation, Physics, etc)
I must admit that I don"t buy in to that philosophy and like using one tool so for scripting I would do all in python, so I would not be answering that question.
Many Linux users think that their way is the only and that means bash as the shell and many others like GNU coreutils, gcc etc. I am an MacOS user and my professional career includes several non Linux Unixes so I know bash is not the only shell - try csh for fun - which is partly why I use python or previously perl as they are the same on all machines
Explaining what the XY problem is to people who are telling you about it's high false positive identification is, itself, an XY misdiagnosis.
Your reply is an example of what people are complaining about - you are addressing the issue you wished was asked, not addressing the issue you were presented with.
But those are correctly diagnosed XY problems. No one is complaining about those.
My parent was told the issue is too many incorrectly identified XY problems, and responded with an explanation of what the XY problem is.
That is the example of a misdiagnosed XY problem, which was kinda my point. This sort of behaviour makes the actual experts leave the site in droves.
If, when answering a question, one where to discard the answer the minute they write "Why would you want to do this?", you'd get much fewer incorrectly diagnosed XY problems.
As I said in a different thread, ChatGPT sometimes does this as well, but at least with ChatGPT, when it is answering a question that was never asked, it doesn't also act like a condescending jackass. There are no "Why would you want to do this?" type of questions.
But on second consideration, I suppose you would not, either, and I suppose you are specific'ly talking about responses which, each taken as a whole, are easily interpreted as some form of hostile.
I responded to the person above me when there were literally two other comments in this thread.
> Your reply is an example of what people are complaining about
Defining something is not an example of an XY problem.
> - you are addressing the issue you wished was asked, not addressing the issue you were presented with.
As I am not much of a programmer but work on electronics and computer hardware I deal with different types of people than would be on SO, so I am not addressing anything but my own experiences.
You may know, but someone else asking the exact same question may not.
So sorry then, but listing every constraint and design descision it is.
You don't need to do that, a simple "I know what the XY problem is, and this isn't it" prefixed to every question you ask should be enough to stop the race to tell you all about the XY problem.
I mean, at this point it's clear that more people know about the XY problem than people ho don't.
True, but that logic goes both ways: Unless told otherwise, whoever reads the question, isn't required to assume that there is a constraint.
If I get asked how to water plants with a sieve, without getting told why getting a watering can is impossible, "You don't, use a watering can", is a perfectly acceptable answer.
Especially when the question is aked in a question archive, rather than a help-forum.
If specific constraints apply to a question, then they should be a part of the question.