I'm trying to write a bash line that will look at all the subdirectories in my current folder and tell me if any do NOT contain a ".git". Pseudo:
for subdir in currentdir
if .git does not exist
print subdir
Here's the one-liner I'm trying, which isn't working and seems to print all the subdirectories:
find . -maxdepth 1 -type d -execdir $SHELL -c '[ ! -d ".git" ] && echo "not git repo:" {}' $SHELL -c '{}' ';'
I've found some solutions that let me print all subdirectories that HAVE a .git, like this one -- I'm trying to do the opposite.
What am I doing wrong? Is this possible?
$SHELL
bit (somewhere...) as a solution to "you can't dotest
usingexec
" but as these answers prove, that appears to have been incorrect. Can you explain why I shouldn't reuse{}
inexec
/execdir
? – Victoria Drake Jun 18 '19 at 11:52find
: https://stackoverflow.com/a/12965441/2072269 – muru Jun 18 '19 at 11:56