Reputation: 35265
It seems like comparing semantic version strings, like this, always outputs the correct result - if the version on the left is greater than the expression would be true
:
'1.12.2' > '1.11.12'
Are there scenarios when it wouldn't?
Upvotes: 1
Views: 168
Reputation: 239521
Are there scenarios when it wouldn't?
Yes, lots:
echo '1.12.2' > '1.101.12'; # true
You cannot compare version strings this way. You may have found some that work, but it's purely coincidence.
Upvotes: 3