I have to maintain versioning of different files in one text file. for example :- if there are 2 files abc-1.0.0.jar and def-1.0.0.jar
so when i run the command this filename with version should be copied inside the text file (lets call it version.txt)
so output of cat version.txt should show the two files abc-1.0.0.jar def-1.0.0.jar
and when the next version (say 2.0.0) of file gets deployed , the version should also get updated in the text file
cat version.txt
abc-2.0.0.jar def-2.0.0.jar
I tried this but not able to update for both file in same text file..
artifact= abc
version= 1.0.0
echo "$artifact-$version" > version.txt
but above command will keep only one one file and if i give below command :-
echo "$artifact-$version" >> version.txt
then this will keep on adding all the versions.
but i need only the updated version for the matching file
Please let me know how to solve this problem.