How to get version number from string in bash
I have a variable having following format bundle="chn-pro-X.Y-Z.el8.x86_64" X,Y,Z are numbers having any number of digits Ex: 1.0-2 # X=1 Y=0 Z=2 12.45-9874 # X=12 Y=45 Z=9874 How can I grab X.Y and store it in another variable? EDIT: I wasn't right with my wording, but I want to store X.Y into new variable not individual X & Y's I'm looking to finally have a variable version which has X.Y grabbed from bundle: version="X.Y"
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.