EDIT/UPDATE: Solutioned! Check how I did this scrolling down.
I'm trying to create an auto-update script, but the problem is that the only mode I can do it is removing the dots from the version number, what can (and probablly will) give an error on the future.
The problem is that I can't use numbers with dot/decimal numbers with "(( $num > $num2 ))". This is a very specific problem :/
The actual script is this:
VER=$(curl --silent "https://api.github.com/repos/user/repository/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' | tr -d .)
INSTALLVER=$(cat $HOME/my-path/example-program-version.txt | tr -d .)
if (( $VER > $INSTALLVER )); then
echo need_update
yes "i" | sudo myinstallscript example
else
echo already_updated
fi
(I get the $INSTALLVER number with "myinstallscript")
If you can help me, very thanks! Also, very thanks for reading!