Skip to content

Instantly share code, notes, and snippets.

View mmmarceleza's full-sized avatar
💭
Learning is the goal!

Marcelo Marques Melo mmmarceleza

💭
Learning is the goal!
View GitHub Profile
@caruccio
caruccio / latest-version.md
Last active March 18, 2024 16:22
Print all latest patch-level version

How to get the latest patch-level version from a list of distinct versions using bash and awk. This idea was taken from https://stackoverflow.com/a/21103864/1006369

Supose you have the following list of versions:

v1.22.8
v1.22.9
v1.22.10   <-- latest v1.22 series
v1.23.1
@caruccio
caruccio / bash-path-vars
Last active December 28, 2023 22:47
Path manipulation with bash vars
$ FILE=/some/path/to/file.txt
###################################
### Remove matching suffix pattern
###################################
$ echo ${FILE%.*} # remove ext
/some/path/to/file
$ FILE=/some/path/to/file.txt.jpg.gpg # note various file exts