Using a $variable with find -name

view full story

http://www.linuxquestions.org – Greets. I'm a little stumped on this one, even after tearing thru the man page and google. Here is my example code that doesn't work: find $HOME -type d -name "$WHATEVER" -exec rm -rfv {} ';' $HOME works ofcourse. it's $WHATEVER that -name doesn't honor. Has to be a variable. I really don't see a way around it because $WHATEVER could be any number of things depending on the circumstance. I've also tried other things: find $HOME -type d -name '\${WHATEVER}\' -exec rm -rfv {} ';' Using backticks will process $WHATEVER but it tries to execute it as a command instead of processing it as an argument to -name.... Any help would be most appreciated. This one has me over a barrel. (HowTos)