Need to get versioning of the branch name dynamically

Hi,

I need to get versioning of the branch name dynamically. can you please help us to achieve this functionality.

curl https://altrecmktg.com/artifactory/mediamarketing/release-2.0.1/altrec.tar
curl https://altrecmktg.com/artifactory/mediamarketing/release-2.0.2/altrec.tar

everytime version will change as 2.0.1,2.0.2,2.03,..and so on..

Appreciate your help on this.

Begs the question, where do you get the version number?

Bit sparse a specification, no?

$ VAR="curl https://altrecmktg.com/artifactory/mediamarketing/release-2.0.1/altrec.tar"
$ TMP=${VAR#*release-}
$ echo ${TMP%/*}
2.0.1

Hi,

For each deployment external team was creating the version numbers .so i have to pick the latest version and pass the version in curl command to download .tar file.

e.g:

Name   Last modified      Size
../
1.0.0/  08-Nov-2018 11:11    -
1.0.1/  08-Nov-2018 14:36    -
1.0.2/  27-Nov-2018 13:55    -
1.0.3/  06-Dec-2018 11:47    -
1.0.4/  19-Dec-2018 10:46    -
1.0.5/  10-Jan-2019 21:26    -
1.0.6/  24-Jan-2019 13:40    -
2.0.0/  04-Feb-2019 16:11    -
2.0.1/  28-Feb-2019 11:08    -

Thx in advance

And what did you run to get that listing? It doesn't look like ls.

Getting additional necessary info on this request is like trying to squeeze blood out of a stone - can't you paint the whole picture in one go so we can stop poking in the dark?
Given your listing is in VERSFILE, try

curl https://altrecmktg.com/artifactory/mediamarketing/release-$(IFS=/ read VERS REST <<<$(tac VERSFILE); echo $VERS)/altrec.tar