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.
awk
approaches there which use nothing butawk
:awk 'NR==2 { print $2 }'
directly in the accepted answer andawk 'END { print $2,$5}'
in a comment to it.(|
)` on the single line solution (and extra commandtr
). I did make an effort to improve Rinzwind's answer with as you say testingprint $2,$5
but could not get the syntax right. I honestly don't knowawk
that well.