2

Is it fine that admin edits the answer in the way that incorrect answer becomes correct answer absolutely equal to mine and my answer becomes useless?

https://unix.stackexchange.com/posts/162223/revisions

Let me summarize the changes made by @Gilles:

The answers before his edit:

------------begin

Use that syntax: ${parameter/pattern/string}

$ echo ${OUTPUT/\'/x}
axb"c`d
$ echo ${OUTPUT/\"/x}
a'bxc`d
$ echo ${OUTPUT/\`/x}
a'b"cxd

------------end

My answer:

------------begin

OUTPUT="${OUTPUT//[\`\"\']/}"

Note that ${VAR//PATTERN/} removes all instances of the pattern. For more information bash parameter expansion

------------end

after Gilles edit first answer became:

-----------begin

Use that syntax: ${parameter//pattern/string} to replace all occurrences of the pattern with the string.

$ echo "${OUTPUT//\'/x}"
axb"c`d
$ echo "${OUTPUT//\"/x}"
a'bxc`d
$ echo "${OUTPUT//\`/x}"
a'b"cxd
$ echo "${OUTPUT//[\'\"\`]/x}"
axbxcxd

---------end

So what was changed?

  • Added quotes - like in my answer
  • Added correct answer string - like in my answer
  • Added comment that // replaces all variables - like in my answer
  • Nothing else

After these edits their answer became essentially the same as mine.

3

The edit in question was done by a fellow user of the site, not an admin. Edits on the site is typical for a variety of reasons:

  • spelling
  • phrasing
  • technical inaccuracies
  • syntax in commands/scripts

In this case the edit was to fix a syntax error where the variable $OUTPUT was unquoted which you should typically never do.

The other fix was to do the same, and put quotes around the arguments to echo and to add a 4th example which showed how the piecemeal search/replaces could be done in a single command.

I don't see an issue with this type of edit, this made this answer more useful, and all the pieces were already contained, this particular edit simply put the pieces together in one line.

Edits in general

The answers that people provide on Stack Exchange sites are not solely to provide a solution to the original poster of the question. The site acts as a knowledge-base for future visitors as well, and these types of edits are done typically with that audience in mind.

Presenting a complete solution, such as this one, is more conducive to these future visitors, since they'll get a fully usable solution, rather than having to piece things together themselves.

  • So what there was one answer which were technically incorrect and another one which were correct? And admin almost rewrites first one to become same as correct? – gena2x Oct 16 '14 at 12:04
  • @gena2x - Again there was no admin involved, this was a user that had editing rights due to his high reputation, the same as any other user that would be at similar reputation levels. It's difficult to speak in hypothetical situations so I'd have to look at this on a case by case instance, but in this case the other answer was technically correct, and had no quotes around the Bash variable which can lead to problems, with specific strings. The addition of the 4th case that was added, only combined the other 3 into a single command. – slm Oct 16 '14 at 12:10
  • You right about absence of the "admin" term - but "user with reputation above >2k" is too long for header - that's why I just called him as "admin". You missing point that answer were technically incorrect because it suggested to use pattern "{VAR/VAL/}" while correct one is "{VAR//VAL/}". – gena2x Oct 16 '14 at 12:14
  • @gena2x - I understand your point, I'm saying that that particular type of edit is typical on SE sites. The use of the term admin implies that a moderator did these changes and none of us did, so I want that to be crystal clear to you and anyone else that may read this. The edit in question was performed by a fellow user of the site, anyone that has earned these privileges is allowed on a SE site to perform these edits. – slm Oct 16 '14 at 12:16
  • 1
    @gena2x - if this is very upsetting to you I would suggest leaving a comment to the other user on the A where the edit was made regarding this. It's entirely possible that this other user may not have even noticed your A when they performed this edit. – slm Oct 16 '14 at 12:19
  • This is not very upsetting for me personally. I am just wondering if that is ok - and is there kind of rules which handle such situation. – gena2x Oct 16 '14 at 12:20
  • @gena2x the rules are basically: "Any edit to another's post that makes the post better is a good thing". – terdon Oct 16 '14 at 12:22
  • Ok, so if let's say I am as user with enough privileges will just replace all random incorrect answer text with cut&paste from correct answer text - that's fine? Doesn't it make post better? – gena2x Oct 16 '14 at 12:25
  • @gena2x - copy/pasting directly in that manner would require attributions to the original. – slm Oct 16 '14 at 12:26
  • Well, I can change wording little bit. And keep little bit of incorrect information intact. – gena2x Oct 16 '14 at 12:27
  • But still, the incorrect answer will be better. – gena2x Oct 16 '14 at 12:27
  • 2
    @gena2x cut & paste is one thing. Correcting a very simple and obvious mistake is another. Your answer is, of course, quite correct, but it is also the obvious answer to the question. This was not some kind of unique and brilliant insight that you had, you just had the necessary knowledge of the shell to know the simplest solution. The other user is also aware of this syntax (see their answer here from February), they simply had misunderstood the question and the edit corrected that. So, nobody stole anything, it was just a simple edit. – terdon Oct 16 '14 at 12:28
  • @gena2x - the other A was better IMO as well since it demonstrated the method of building up to how the ultimate solution would work. The edit in Q simply added that element to an A that was superior to yours since it explained through code the progression of how one could attack the problem. But remember this is me as just a community member saying this as an IMO. – slm Oct 16 '14 at 12:32
  • What about correcting 3 mistakes and adding comments about this corrections, increasing answer twice in size? Shouldn't person with rights first check if there is already correct answer? Are there are one rules for "brilliant" answers and different for "obvious" and how to measure which one is "brilliant" or "obvious"? – gena2x Oct 16 '14 at 12:34
  • 1
    @gena2x - your A is what we'd call "here's the codez" while the other shows a method/process for breaking the problem down into pieces and solving it. A'ers that simply contain code are typically discouraged, since they're not useful content for the site. That don't teach anyone anything. SE sites are trying to teach people to fish, not simply feed them. – slm Oct 16 '14 at 12:39
3

First of all, there's no such thing as an "admin edit". Anyone can edit a post, once you have 2k reputation, you can do so directly but before that you can still submit an edit which will have to be accepted by 2 users with >=2k reputation.

That said, the objective of the site is to have a collection of useful information, of good answers. It is more like a wiki than a forum. The edit you mention clearly improved the answer so, yes, it is perfectly acceptable. Also, it was a very minor edit, correcting a misunderstanding of the question. Since a global substitution was requested, the edit made the answer fit the question. Your answer is no less useful because of that, it has simply been joined by another correct answer.

So, your answer is no less useful now than it was when you posted it. There is no limited pool of correctness where adding to one answer would remove from yours. The more correct answers we have, the better.

  • I could just see that 'workflow'. If you have 2k, if you don't like someone for example (not saying this is the case!): go to random question there person provides right answer, change or make another one which is exactly same as answer of the person you don't like - and this could make someone happy. – gena2x Oct 16 '14 at 12:09
  • 2
    @gena2x I don't follow. If you post a new answer containing the same information as one already posted, that is likely to get downvoted or even deleted. If you change a right answer to a wrong one, that edit is almost certainly going to be rolled back. At the very least by the person who posted the answer but, if not, by whoever notices it first. – terdon Oct 16 '14 at 12:16
  • I am talking about the case if you edit incorrect old answer to become same to new correct one. – gena2x Oct 16 '14 at 12:18
  • @gena2x Making it identical would be silly. Editing it to suggest the same approach is different. The edit in question did not make the answer identical to yours, instead it simply included the same information from yours but also the added details that the original answer had but yours lacked. So, now we have a more complete answer and everybody benefits. – terdon Oct 16 '14 at 12:22
  • I think he means in a destructive way. If this were to occur the moderators of the site are overseers, elected by the rest of the community, we would discuss the actions with this user, after reverting the destruction, and if the behavior continued, could suspend this user indefinitely if needed. – slm Oct 16 '14 at 12:24

You must log in to answer this question.

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