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 (220.127.116.11 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 18.104.22.168 or 22.214.171.124 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.