In this question, Command to display an arbitrary message if a particular file exists, Byte Commander and I answered within a few minutes of each other, with very similar answers. The main differences being that his example uses [
while mine uses [[
, and we suggested different conditional tests but both referenced the other useful test options. I also included a link to a useful resource on using conditionals in Bash for the 'teach a man to fish' factor.
To be honest, it was a fairly quick answer, that I bashed out before leaving the house. Byte Commander's answer was accepted, which is fair enough, you can only accept one answer.
I've been surprised by the difference in votes, for essentially the same answer. I'm not moaning about not getting my rep (well maybe a little! * tear drops into coffee*), but a bit of advice about what I should have done differently would be useful.
Or is this just one of those luck of the draw situations?
[[ ]]
preferable to[ ]
?[[ ]]
! chalk it down to experience I guess.