[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

script copy files based upon content




I am trying to figure out how to come up with a shell script that will cat
or grep a file and if it contains the word SPAM it will then move it to
another folder.

I have been trying combinations of grep SPAM * | mv * ../spam however I
don't know what to put in for * since the filenames are always changing.

I am guessing that I need to create an array by doing something with ls,
however I am having trouble puzzling this one out.

This job would then run out of cron.

Help is greatly appreciated.




Reply to: