I am trying to find a file by a specific path / location.
Sample Path - /var/log/<parent1>/<parent2>/<folder>/file
Now there are two directories <parent1> and <parent2> as shown in the sample path. These two directories have a random name, so their names cannot be predicted. With the exception of these two directory names, each part of the path is known.
I tried doing something like this -
if ( -e $filePath ) {
But that does not work. So how to search for a specific file?
Thanks!
source share