I have to compare two version numbers (e. g. 5.6.2
and 5.7.0
) in bash. But the function only has to return true
if it is a higher or lower minor release number.
Examples:
| Old Version | New Version | return |
| ----------- | ----------- | ------- |
| 5.6.2 | 5.7.0 | true |
| 5.6.2 | 5.6.9 | false |
| 5.6.2 | 5.6.9 | false |
| 5.6.2 | 5.5.0 | true |
| 5.6.2 | 5.8.8 | true |
| 5.6.2 | 6.0.0 | true |
| 5.6.2 | 4.0.0 | true |
Can anyone help me with this? I've tried to edit the function from BASH comparing version numbers but I couldn't get it run correctly.