How do you output the filename in find command while using -exec?
Solution 1:
simply add a -printf
option before
find -printf '%p' -exec command \;
Solution 2:
If you don't want to recurse, there's no point in using find
. It is far simpler to do it in the shell directly:
for d in */; do echo "$d"; svnadmin verify "$d"; done
The for d in */
will find all directories (the */
ensures only directories and no files are found); the echo "$d"
will print the directory's name; the
svnadmin verify "$d"
will check the directory.
This can be run either directly from the command line or from within a script with no change in format.
Solution 3:
find ./* -maxdepth 0 -type d -exec bash -c 'echo "{}"; svnadmin verify "{}"' \;
I have added -type d
if it is only directories.