I'm writing a shell script that has to know if a certain program version is less or equal to version x.xx.xx
here is an example script to try and explain what I want to do:
#!/bin/bash
APPVER="some command to output version | grep x.xx*
"
if [[ "$APPVER" is smaller or equal to "x.xx*" ]]; then
do something
else
do something else
fi
is there a way to do that? I found ways to compare numbers, but they won't work with version numbers. I need a solution that uses no or as little as possible programs.
any help is appreciated!