I have a command in a Korn script which is like as written below,
find <path1> <path2> <path3> -name filename
After this, it stores the output in a txt file. Using this txt file it does some operations.
Is there any way using which if the required file is found in path1, then the find command would not search in path2 and path3 and would stop?
I tried using -quit option, it it seems -quit
option does not work with the IBM AIX version of find. There is no locate
command in the system. Neither do I have permissions to install.
Using the pipe option with head -1
would do the job but if there is no other file in path2 and path3 and the file is only in path1, then it would still go the whole mile and search all the paths.