I am trying to extract a value from a long string that may change over time. So for example the string could look something like this
And what I want to extract is the value between filename- and .tar.gz, essentially the file version (18.104.22.168 in this case). The reason I need to do it this way is because I may later run the command and the value will be 22.214.171.124 or 126.96.36.199 or something entirely different.
How can I do this? I'm currently only using grep, but I wouldn't mind using other utilities such as sed or awk or cut or whatever. To be perfectly clear, I need to extract only the file version part of the string, since it is very long (on both sides) everything else needs to be cut out somehow.