I have a directory named .poco that has subdirectories at different levels. Some have *.css files in them. Some don't. The following script fails on line 4 (the second for loop) if the current directory has no .css files in it. How do I keep the script running if the current directory doesn't happen to have a match to *.css?
#!/bin/zsh
for dir in ~/pococms/poco/.poco/*; do
if [ -d "$dir" ]; then
for file in $dir/*.css # Fails if directory has no .CSS files
do
if [ -f $file ]; then
v "${file}"
fi
done
fi
done