FW: script copy files based upon content

2005-08-07 Thread David Christensen
Michael Martinell wrote: 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. http://www.quotationspage.com/quote/2279.html http://www.oreilly.com/catalog/learnperl4/ HTH, David

Re: script copy files based upon content

2005-08-07 Thread Bryan Donlan
On 8/5/05, Michael Martinell [EMAIL PROTECTED] wrote: 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

script copy files based upon content

2005-08-05 Thread Michael Martinell
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

Re: script copy files based upon content

2005-08-05 Thread Ryan King
On Fri, Aug 05, 2005 at 06:58:58PM -0500, Michael Martinell wrote: 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

Re: script copy files based upon content

2005-08-05 Thread Ryan King
On Fri, Aug 05, 2005 at 08:31:30PM -0400, Ryan King wrote: On Fri, Aug 05, 2005 at 06:58:58PM -0500, Michael Martinell wrote: 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. Try something like

Re: script copy files based upon content

2005-08-05 Thread Chris Palmer
Ryan King writes: The other weirdish piece is the /dev/null, which is just so that it doesn't output anything even if it does match (which you expect to happen. It's better to use -q. That way grep can terminate right away when it finds the first match. -- To UNSUBSCRIBE, email to [EMAIL

Re: script copy files based upon content

2005-08-05 Thread Tong
On Fri, 05 Aug 2005 18:58:58 -0500, Michael Martinell wrote: 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 [...]