Need to get versioning of the branch name dynamically


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to get versioning of the branch name dynamically
# 1  
Old 03-01-2019
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.

Code:
curl https://altrecmktg.com/artifactory/mediamarketing/release-2.0.1/[/B]altrec.tar
curl https://altrecmktg.com/artifactory/mediamarketing/release-2.0.2[/B]/altrec.tar

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

Appreciate your help on this.
# 2  
Old 03-01-2019
Begs the question, where do you get the version number?
# 3  
Old 03-01-2019
Bit sparse a specification, no?

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

# 4  
Old 03-01-2019
need help

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:
Code:
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




Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 03-01-2019 at 04:15 PM.. Reason: Added CODE tags.
# 5  
Old 03-01-2019
And what did you run to get that listing? It doesn't look like ls.
# 6  
Old 03-01-2019
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
Code:
curl https://altrecmktg.com/artifactory/mediamarketing/release-$(IFS=/ read VERS REST <<<$(tac VERSFILE); echo $VERS)/altrec.tar


Last edited by RudiC; 03-01-2019 at 05:37 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Versioning up a file with initials?

I have this code that works great ... #!/bin/sh for file in "$@" do ext=${file##*.} base=${file%.*} num=${base##*v} zeroes=${num%%*} num=${num#$zeroes} #remove leading zeros, or it uses octal num=$((num+1)) base=${base%v*} ... (5 Replies)
Discussion started by: scribling
5 Replies

2. SCO

Versioning through undelete

Hi , I am using SCO openserver realease 3.2 and tried to test versioning on a directory with undelete -s . The command executes well but it is not creating any versions of the files in it. I have also setted versioning options via filesystem and then remounted it but of ... (0 Replies)
Discussion started by: dextergenious
0 Replies

3. Programming

binary versioning

Dear Members, Do you know any information about versioning a binary file. That means test.out 1.0.0, 1.0.1, 1.1.0, and so on. Can I manually edit version number (both major and minor) and revision number myself (how?) or any utility to set version number (which one?). Best Regards, Francesco (2 Replies)
Discussion started by: francescoandrio
2 Replies

4. Solaris

Solaris versioning

Please correct me if I am wrong... Isnt the only difference between minor releases of Solaris, ex. 9/04 and 9/05, is the patche revs between them? If so, why does the /etc/release info stay static when patched? (4 Replies)
Discussion started by: mhm4
4 Replies
Login or Register to Ask a Question