I am trying to assign a string of numbers with their decimals to a variable. The code reads a file called 'log'. I have not included the entire file since it's huge.
The line is:
Tagging release with the label program-2.8.114...
My code:
BUILDNUMFORSIT=$(egrep 'Tagging release with the label program-' log | grep '[0-9]\{1,\}.[0-9]\{1,\}.[0-9]\{1,\}')
My output:
BUILDNUMFORSIT=' Tagging release with the label program-2.8.114...'
My desired output:
BUILDNUMFORSIT=2.8.114
Please help!