I have several versions of a certain software (lets call it MySoftware)installed and I like to find the path to a specific version with a combination of find and grep.
Assume I have the following versions:
1.12.0
1.12.2
1.42.2
It is stored in the following way:
~/src/MySoftware/1.12.0/...
~/src/MySoftware/1.12.2/...
~/src/MySoftware/1.42.2/...
In a shell I could do something like find . -name MySoftware | grep 1.12.0. This is working since the command is giving me the ~/src/MySoftware/1.12.0/ path.
However, when switching to a shell script, I try to do this:
find . -name "MySoftware" -exec grep "1\.12\.0" {} ';'
The example above is, however, not returning anything and I have no idea why. Other tries with grep -HF "1.12.0" are also not working. I am grateful for any advice
MySoftwarecontains string1.12.0?find . -name MySoftware | grep 1.12.0gives~/src/MySoftware/1.12.0/