2

I wrote the following answer:

enter image description here

Contrary to what the moderator wrote, without any intention of critiquing or requesting clarification, I wrote that answer because -bash: syntax error near unexpected token `;' was marked as a duplicate of that question. And none of the answers in the dup or the original question provided an answer for my situation. My answer provided a different solution for that error

I've been using stackoverflow.com for about 5 years now, and I've never had my question deleted like this. Worst case scenario is that the answer was left there to be downvoted. This was too quick and too harsh.

| |
  • 1
    I'd guess that the policy on deleting answers may differ to some extent across Stack Exchange sites. For instance, the attempt I started to reach the definition of some guidelines for this site about which answers should be deleted from the Low Quality Posts review queue has shown that there is no clear consensus among the users of U&L. – fra-san Mar 22 at 20:51
  • @fra-san why is it even made a candidate for a low quality post? I gave an answer to this error: bash: syntax error near unexpected token ;' Does it make the error go away? Yes. – Honey Mar 22 at 21:00
  • The mention to the LQP queue in my previous comment is not really relevant to the point. I'm only addressing the "...and I've never had..." part of your question: the same kind of answers may happen not to be handled in the same way on SO and U&L. – fra-san Mar 22 at 21:57
  • 1
    I added an answer here, Maybe it would be more relevant to you. – Isaac Mar 22 at 23:22
6

It appears to me as if your specific issue was quite different from the issue in the question.

Both the code and the error message in the question is different from what you had, so I'm not quite sure how your answer is relevant to the question as it doesn't actually provide a solution to it. Note that similar error messages can have very different causes.

The question at hand contained a number of errors, which is probably why it wasn't closed as "off topic (typo)". There was a bit more explanation needed to resolve it than just saying "you forgot to insert a semi colon".

In contrast, your answer did not address the code given in the question at all.

The duplicate, "-bash: syntax error near unexpected token `;'", is a duplicate, not because of the error message (which is different), but on account of doing the exact same things wrong. These are

  1. No space immediately inside [ and ].
  2. No semi colon before then or before fi.

Your issue, on the other hand, would be a duplicate of the question "Why isn't a semicolon accepted after then?", not of the question that you answered, since the cause of your error is putting a semi colon after then (a shell keyword).

| |
  • It's not entirely different. The question I answered had a title of bash: syntax error near unexpected token }' I addressed bash: syntax error near unexpected token ;'. Which is very similar. Can you tell me how can I add an answer to this question: unix.stackexchange.com/questions/93012/… ?If it's marked as dup, then I should be able to answer it as whatever it's assumed to be equal of – Honey Mar 22 at 20:50
  • 1
    Kusalananda has addressed the reason I deleted it. I happened across it in a review queue. – Jeff Schaller Mar 22 at 20:54
  • More so, being new to bash scripting, I thought I have to end everything with a ;. My answer was to open that open, no matter how simple. It's still an answer. After all a lot of bash related questions are about not properly understanding how the language works, which end up being a typo. But the root cause is not a keyboard typo. It's lack of understanding the language – Honey Mar 22 at 20:56
  • 1
    Additionally questions get marked as duplicate because they have the same error message. Are you suggesting that I create a new question with my own error an answer it myself. I think that's incorrect. What needs to be is that the unix.stackexchange.com/questions/93012/… should be unduplicated because they're different errors. That way I can provide a different answer for that error. – Honey Mar 22 at 21:04
  • 1
    @Honey I have addressed the issue of the duplicate in my updated answer here. Your own issue would be a duplicate of "Why isn't a semicolon accepted after then?". – Kusalananda Mar 22 at 21:48
  • I can write it there too. But given that if you do a google search for "-bash: syntax error near unexpected token `;'" verbatim, your first result is unix.stackexchange.com/questions/93012/… makes it valid to write in that question too. I think the root of the difference of our mindsets is: for a given error message, are answers for other ways of triggering that error message allowed? My answer is yes. If your answer is no, can you provide a reference from the guidelines? Or perhaps update the guidelines to match your opinion – Honey Mar 22 at 22:19
  • 2
    @Honey The problem I have here is that you don't have (the same) error message; yes, it's similar, but even one small technical difference could matter to people searching for those Q/A's in the future. I take my guidance from the Help Center regarding duplicates: There are many ways to ask the same question, and a user might not be able to find the answer if they're asking it a different way. – Jeff Schaller Mar 23 at 16:36
  • I don't understand how concluded that. Do I not have "-bash: syntax error near unexpected token `;'" triggered? – Honey Mar 23 at 16:52
  • 1
    @Honey It doesn't really matter what the error message says if the issue that caused the error is different. Are you proposing to collect all "no such file or directory" issues in the same Q/A? – Kusalananda Mar 24 at 10:42

You must log in to answer this question.

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