I was a little late to the part posting an answer to this question: How to get a substring from bash command

We are all proud parents of our posted answers so I'm probably biased but I think my answer is better than Windy's accepted answer because:

  • It uses cut which OP was trying to master
  • Uses one command instead of two

Without offending @Rinzwind (Waves to Windy) who I've known for many years and admire and without nagging / whining at OP, what comment would I post to have them reconsider acceptance.

Forget the fact you judge Windy's answer is better or my answer is better. How would you phrase the comment to OP?

This isn't necessarily about "winning" the 15 points. It's more about the fact we want future readers to get the most bang for their free Linux buck.

You can tell me I suffer from Obsessive Compulsive Disorder if you want to :)

@Fabby confessed to me once how he made chatroom for OP and told OP to let me keep bounty but after period ended to accept Fabby's answer instead. That method makes sense but I think that is overly complicated.

  • 3
    What do you mean by saying it “Uses one command instead of two”? Your approach needs three tools while there are two awk approaches there which use nothing but awk: awk 'NR==2 { print $2 }' directly in the accepted answer and awk 'END { print $2,$5}' in a comment to it. – dessert May 1 at 6:02
  • @dessert I meant one-liner using a single pipe line. True there is an extra (|)` on the single line solution (and extra command tr). I did make an effort to improve Rinzwind's answer with as you say testing print $2,$5 but could not get the syntax right. I honestly don't know awk that well. – WinEunuuchs2Unix May 1 at 10:45
  • 1
    Be humble, in the end it was proven your answer was not the best. – noraj May 1 at 11:37
  • @noraj My answer doesn't exist from OP's view point. They haven't signed on to see it.... – WinEunuuchs2Unix May 1 at 11:46
  • @wineunuuchs2unix So you decided to down-vote my answer... – noraj May 1 at 16:43
  • @noraj I haven't down voted in so long I forget the last time I down voted. As a general rule of thumb I don't believe in it. Where did you get down voted? Can you provide a link maybe mod can research it. I've given 4,126 up-votes and only 92 down votes. I didn't up-vote Windy's answer here but have up voted many of his. I up voted OP's question though yesterday. – WinEunuuchs2Unix May 1 at 22:38
  • @WinEunuuchs2Unix Fine, coincidence due to bad timing so. – noraj May 2 at 7:33

Honestly? Just don't do it.

The OP gets notified about every new answer to their question, so you can assume they've either seen it already or they have no interest in checking their notifications. Promoting your answer to them, however politely, is likely to come across as unnecessary hassling. They might feel it would be rude to unaccept an answer and find the whole situation uncomfortably pressured, no matter how pleasantly you put it across.

Your answer may well be better (I'm not going to look), but the OP has accepted a different one. This happens all the time and it only really matters when the accepted answer is really bad or dangerous. The OP is usually not an expert on the topic, so votes are usually a better indication of answers' value (or popularity) than acceptance. Sure, many visitors will go straight for the accepted answer, but if they can spare more than 30 seconds to solve the problem they'll probably scroll down. I always do.

Now it's possible that the person whose answer was accepted will see your answer and think it's way better than theirs and closer to what OP really wanted. That person is in a position to suggest to the OP that they might consider changing their accept. If I really really wanted to pursue this, I'd approach the person whose answer was accepted and not the OP.

Early on I was very interested in getting my answers accepted. Of course I had been telling myself that getting accepts was helping the site or visitors or whatever. But I don't think that's really true. Its only significant benefit IMHO is making it possible for an unappreciated question by a new user to show up as answered. I don't think seeking accepts for my own posts does the site any favours and I think it gives a poor impression to the OP.

  • When you say "Your answer may well be better (I'm not going to look), but the OP has accepted a different one." you should know that the OP accepted the first and only answer. My answer came about 8 hours later. Would this influence your judgement? +1 BTW :) – WinEunuuchs2Unix May 1 at 3:58
  • 4
    @WinEunuuchs2Unix You pointed out, and I saw, that your answer was posted later. This doesn't affect my view that it's not proper to try to persuade OP to accept your own answer instead of another one – Zanna May 1 at 4:01
  • It's more confusing because the question title doesn't reflect the body of the question. If the title was "How can I use cut to extract columns delimited by fluctuating white space?" I would have felt more comfortable pointing out reevaluating answers. Because the title is: "How to get a substring from bash command" any answer under the sun will work. Thanks for your analysis! – WinEunuuchs2Unix May 1 at 4:34
  • @WinEunuuchs2Unix please do edit the title to make it more descriptive if possible :) – Zanna May 1 at 4:59

My answer would be that you shouldn't, and I must say both as the one who asks, as well as the author of the accepted answer, I'd consider it a kind of a contempt.

while anyone has the right to vote for (or against) the quality of an answer, it is the exclusive privilege of the one who asks to accept whichever answer he or she considers most useful. OP does not need to defend his choice, nor should anyone use any pressure to accept this or that. I have seen it in the past more than once, and found it horrible without exception, Not to mention that I often disagreed with the claimed "this is the best answer".

Really good answers will often attract more votes over time, accepted or not. The gloomy attempt to push someone simply isn't serving any goal.

  • +1 but I though Windy had the accepted answer and not yourself? When my answer got unaccepted and awarded to Fabby I didn't agree but I didn't think of it as contempt. I just shrugged my shoulders and moved on. I agree the future will judge history and the more upvotes in the end will work out over time. You often see unaccepted answers with more upvotes than accepted answers. Indeed often comments posted that accepted answer should be changed. Sometimes the OP will change accepted answer of 100+ votes to brand new answer with 1 vote. Anything can happen in future. – WinEunuuchs2Unix May 1 at 22:43
  • 1
    Someone changing the accepted choice is (of course) no problem. insights and/or information can change. That is something completely different from suggesting someone to change the choice of the accepted answer. Bluntly said: the choice is no ones business but OP's – Jacob Vlijm May 2 at 15:15

My take on this particular link is I would never ask OP to change acceptance to my answer. I would point out that my comments made from "smartphone" were in error and I posted an answer still using cut but prepending pipe line with tr to condense contiguous whitespace.

I have on a few occasions asked OP to change acceptance to a different answer that is not my own. Reasons for this could be:

  • Accepted answer is to a software package no longer supported or incompatible with current Ubuntu releases.
  • Accepted answer could be dangerous if used improperly.
  • Accepted answer involves too much hacking or is inefficient.
  • Accepted answer simply doesn't work today or perhaps never worked at all.

I have accepted answers to my own questions as a way of awarding someone who answered that provided could insights to help me solve the problem.

In that case though I will post my own answer pointing out it is the best solution but thanking first answer and pointing out that is the reason for my acceptance.

I have posted a new answer five years later and the OP took away acceptance from a ~100 up voted answer and awarded to me. But in no shape or means did I request that.

I'm guilty of awarding a bounty to an answer that didn't solve the suspend/resume issue. But I did not accept the answer. I made it known the bounty was awarded solely for hard work.

This Q&A was intended for discussion. I have the upmost respect for Windy and have upvoted numerous of his answers along with the usual suspects Serge, Zanna, Terdon, Jacob, Fabby, Muru, etc.

I often get heavily down voted with discussion topics but that's the nature of soliciting opinions. I'll never be a politician :)

  • 3
    Oh wait. there is always the question: what are we voting on: the quality of the question, or the statement it might suggest. Many heavily downvoted questions on meta are good ones, but their suggestion is downvoted, despite the fact that it is actually a good question, and a contribution to the quality of the site because it makes people think. – Jacob Vlijm May 2 at 7:45

This in the question:

but I'd like to have the most recommended approach.

made me drop any interest in cut. Great command but it can't stand in the shadow of awk. Heck it even the command sounds more awesome.

For manipulation of text I depend on 2 tools: sed and awk.

  • 1
    My love for awk is deep and pure, but if you want speed cut will always win for those few cases where it can be used. I mean, awk is far more versatile, but for the simple tasks where you can use either awk or cut, cut will always be faster. – terdon May 1 at 7:56
  • The answer in part was to show how tr can be used to condense continuous white space into single space so cut would work. OP had said how cut wasn't working when multiple spaces separated columns. It's helpful when OP has existing code using cut and just needs to add one little thing into the pipeline (|). – WinEunuuchs2Unix May 1 at 10:39

You must log in to answer this question.

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