Hey, You're awesome, i was screwing up the script by passing:
"*bb*" as $2 when it was already specified in the script as "*$2*" so that's what it was!
Thanks a lot!!!
It didn't work
I got this an output...
mv: cannot move `./aa/bb' to a subdirectory of itself, `./aa/bb/bb'
mv: cannot move `./aabb' to a subdirectory of itself, `./aabb/aabb'
mv: cannot move `./aabbcc' to a subdirectory of itself, `./aabbcc/aabbcc'
mv: cannot move `./aabbccdd' to a subdirectory...
Hi,
I'm trying to write a script to find directories/subdirectories with a certain pattern in the name, then replace the pattern in the directory name.
I figured out how to find them using find $1 -type d -name "*$2*" but it's the replacing that's giving me a migraine... please help!
TIA.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.