rather new to unix. Trying to create a script to loop through all files and subdirectories given a directory and printing them. I would like to be able to skip certain directories dynamically though.
My idea was to create a for loop,
for i in $(find ./ -printf '%f\n')
as this will iterate through everything from the given directory, but I was curious if there was a way to skip over a directory if I came across one I didn't want to go down.
if [ "$i" == something I don't want to go down ] then skip this directory fi
Wasn't sure if it was possible. Found ways to skip directories using prune function but this requires you to know the types you want to skip beforehand, at least that was my understanding. Thanks.