Tried "find" to perform conditional depth search
by BudiKusasi from LinuxQuestions.org on (#58RPQ)
Tried to have "find" to perform conditional depth search,
if the found is in current dir. and the found is a file then do explain its output with verbal, else then do output just like normally
Code:$ find ~+ -maxdepth 1 \( -type f -printf 'File: %p\n' -o -printf '%p\n' \) -o -mindepth 2 -printf '%p\n'
find: warning: you have specified the -mindepth option after a non-option argument (, but options are not positional (-mindepth affects tests specified before it as well as those specified after it)..Why is it failed and How to solve such the demanded condition ?


if the found is in current dir. and the found is a file then do explain its output with verbal, else then do output just like normally
Code:$ find ~+ -maxdepth 1 \( -type f -printf 'File: %p\n' -o -printf '%p\n' \) -o -mindepth 2 -printf '%p\n'
find: warning: you have specified the -mindepth option after a non-option argument (, but options are not positional (-mindepth affects tests specified before it as well as those specified after it)..Why is it failed and How to solve such the demanded condition ?