curl - Implement version checking in a bash script -


i implement version checking in bash script, verify file on website, , if version of script not match last version, opens web page. heard use curl, didnt find tuto case.

i'm gonna write do:

#configuration version=1.0.0 url='http://example.com/version' dl_url='http://example.com/download' #later on whenever want # assume url displays current version number check_version=$(wget -o- "$url") # if remove periods, works way # lexicorigraphically compare version numbers numbers current_number=$(echo "$version" | tr -d '.') new_number=$(echo "$check_version" | tr -d '.') test "$current_number" -gt "$new_number" || x-www-browser "$dl_url" 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -