Script to find only files that contain pattern

Actually I googled it and found != *Frequent* works!
So now I have zero questions
Thanks for reading, anyway!

Actually I got this working see below. I just now have one question:

How do you use a test condition (such as with Frequent) that takes whitespace into account
for example, if the file is Frequent List Home Items?
At this point the condition breaks up the file

MYDIR="/local/mnt/Lists"
eval cd $MYDIR for i in  `ls -d */` ; do (cd $i && for file in *; do [[ -d 2015 ]] ||  mkdir 2015; cd "2015"; [[ -d 01-January ]] ||  mkdir 01-January; cd ".."; dir=$(echo "$i"|sed 's/\/$//g');if [[ -f "$file" ]] && [[ "$file" != M-* && "$file" != Frequent ]]; then echo mv "$file" /netapp/bank/vol0/vertices/Move\ Lists/$dir/extras; fi;done);done
MYDIR="/local/mnt/Lists"
eval cd $MYDIR
for i in  `ls -d */` ; do (cd $i; echo $i && for file in *; do
[[ -d 2014 ]] || mkdir 2014
cd "2014"
[[ -d 01-January ]] || mkdir 01-January
[[ -d 02-February ]] || mkdir 02-February
[[ -d 03-March ]] || mkdir 03-March
[[ -d 04-April ]] || mkdir 04-April
[[ -d 05-May ]] || mkdir 05-May
[[ -d 06-June ]] || mkdir 06-June
[[ -d 07-July ]] || mkdir 07-July
[[ -d 08-August ]] || mkdir 08-August
[[ -d 09-September ]] || mkdir 09-September
[[ -d 10-October ]] || mkdir 10-October
[[ -d 11-November ]] || mkdir 11-November
[[ -d 12-December ]] || mkdir 12-December
cd ".."
dir=$(echo "$i"|sed 's/\/$//g')
if  [[ "$file" != *20[1-2][0-9]* && "$file" != M-* ]];
then echo mv "$file" /tmp/additions;
fi
done);done

It works just fine - the only problem is that it will try to move all the directories as well as files. I've tried the following to stop this but it hasn't worked:

dir=$(echo "$i"|sed 's/\/$//g')
if  [[  -f "$file" ]] && [[ "$file" != *20[1-2][0-9]* && "$file" != M-* ]];
then mv "$file" /local/mnt/Lists/$dir

What I get with this is nothing is moved..

If I do not use

[[ -f $file ]] 

then directories are picked up, if I do use it, then nothing is moved.

Does anyone have any ideas?

I think I will try the find command.

You are actually excluding anything with a number between 2010-2029.

..."$file" != *20[1-2][0-9]* ...

hth

What, at the

 [[ $file != 

point do you intend $file to contain?