5
3
Assuming I have a directory structure like
Dir1/
SubDir1/
SubDir2/
SubDir3/
I'd like to be able to pass 'Dir1' to a bash script and then perform an action on all of it's subdirectories (SubDir1, SubDir2, SubDir3).
Thanks for your help!
Why do you suggest the second method when using 'rm' instead of the first? – evan – 2011-01-20T01:44:45.703
Yes, I just re-ordered them. I think the
for dir in $basedir/*
way is simpler. – Mikel – 2011-01-20T01:47:31.633Ok cool, thanks! I'm new to scripting so I wasn't sure if they were just two ways to do it or there was some other reason to use the one method over the other. – evan – 2011-01-20T01:48:39.567