0
I am writing a code in Shell Script to download the source code of the last updated version of Postgresql checking the current version automatically.
So based on that I did the following:
created the variable URL_PKG
URL_PG=${URL_PG:-https://ftp.postgresql.org/pub/source}
The current version of Postgresql is 10.3
So I created the following variable:
bash-4.4$ echo SVERSION=${SVERSION:-$(lynx --dump ${URL_PG}|awk -F'/' '/v[0-50]/ {print $1}'|cut -c8-12)}
She returns it to me below:
SVERSION=1.08 1.09 10.0 10.1 10.2 10.3 ttps: ttps: ttps: ttps: ttps: ttps:
As I create the command to take the larger value of the folder inside the link so if I run it take the name of the folder "V10.3" and successively if the version is 10.4?
to then give the following exit:
bash-4.4$ echo URL_DB=${URL_DB:-${URL_PG}/${SVERSION}}
URL_DB=https://ftp.postgresql.org/pub/source/v10.3