Created
December 28, 2023 09:08
-
-
Save boltronics/dfdb51e5cd99a7a8800e3ee219479128 to your computer and use it in GitHub Desktop.
Print the current version number of Firefox for Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Print the current version number of Firefox for Desktop. | |
FIREFOX_RELEASE_FOLDER_URL='https://download-installer.cdn.mozilla.net/pub/firefox/releases/' | |
get_current_firefox_ver() | |
{ | |
elinks -dump 1 -no-numbering "${FIREFOX_RELEASE_FOLDER_URL}" | | |
grep -E '^ \. ' | | |
sed 's/^ \. //' | | |
grep '/[0-9]\+\(\.[0-9]\+\)\{1,2\}/' | | |
sed 's/.*\/releases\/\(.*\)\//\1/' | | |
sort -V | | |
tail -n 1 | |
} | |
get_current_firefox_ver |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment