5

This question: Why cat, grep and other commands can't understand files starting with minus sign? was marked as duplicate of this question: How do I delete a file whose name begins with "-" (hyphen a.k.a. dash or minus)?

disclaimer: I posted an elaborate answer for the why-question.

The text of the how-question is straight forward: how to solve the problem?

The text of the why-question reads more like a rant. One sentence in the text actually does ask how to solve the problem. The title is, IMO, dominating the question: why does the problem exists?

If it really is a duplicate then when the answers are merged the answers of one question should also answer the other question. In this case my answer for the why-question feels very out of place in the how-question. As well as the answers for the how-question feel very incomplete in the why-question.

Is it policy that why-questions are generally considered duplicate of how-questions?

If I edit the text of the why-question to remove that little reference to "how" and enfore the "why", would it be reopened?

  • People tend, rightly or wrongly, to mark new questions as duplicates of old ones. I liked your answer as it focuses on teaching the principles behind command line options. However, this is a really common problem and most people looking for the solution would appreciate a shorter answer. So I can see it either way. – Jon Ericson Aug 21 '13 at 14:46
5

The question is not really asking why cat --1 isn't working: the asker did understand that this was because cat is interpreting --1 as an option. The real question is

Is there any universal workaround different from not using such file names?

So yes, the question is a duplicate. Unfortunately, the earlier question has pretty poor answers, inherited from the early days of the site, with a lot of upvotes but not much in the way of explanations. Your answer is a lot better (though still incomplete, as you don't explain the peculiarity of - or why quotes don't help).

There's no rule that the newer question has to be closed as a duplicate of the older one. It's the typical case, but in general the question with the worse answers should be closed as a duplicate of the question with the better answers. So we should invert the duplicate closure.

(Unless there's already another better duplicate? I thought I remembered an answer by Stephane Chazelas that went through all of this, but I can't find it.)

  • I disagree with you about the "real question". I think the title is the real question. Alas, only the question asker could answer that. – lesmana Aug 21 '13 at 19:40
1

I came here with the same question as OP. Assuming a person asking a question is using the English language properly, "how" and "why" can drastically change the question being asked. I don't believe these should generally be assumed as duplicates unless it is painfully apparent in the body of the question that the same answer is being sought. In which case, the question title probably needs editing.

For example, the following question turns out to be an entirely different question than the one it is said to be duplicate of:
how to execute a bash script without typing ./ [duplicate] - OP is essentially asking how to set the PATH variable for a script's directory so the user does not have to type the path to file each time it is executed.

Compare the above question to the one it is said to be duplicate of:
Why do we use “./” to execute a file? - In this case OP specifically asks why this syntax is used this way in the shell. No question is raised as to whether there is a method for executing files without specifying the current directory path.

Thanks.My doubt is why do you need ./ at the start.... I got the use of "." (to poit the current directory) but why "/" after that? Renjith G Nov 30 '10 at 8:35

The result is two very different questions prompting different answers. As reflected in the above examples, the answers for neither appear to appropriately answer for the other. Comparing similar "how" and "why" questions as possible duplicates may call for more careful consideration than usual.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .