So to find what I needed I had to do this:

> find /var/mail/vhosts/ -name '*SPAM*' -type d

That got me the results I was expecting.



> On Mar 21, 2015, at 1:14 PM, Ryan Coleman <ryan.coleman at cwis.biz> wrote:
> 
> Aha! Yeah, that’s what I was trying to think of.
> 
> 
>> On Mar 21, 2015, at 1:09 PM, Saul Alanis <sdalano at gmail.com <mailto:sdalano at gmail.com>> wrote:
>> 
>> The one command to search for by directory names that can be piped.
>> 
>> find /path -name 'SPAM' -type d | xargs <commands>
>> 
>> On Mar 21, 2015 12:33 PM, "Ryan Coleman" <ryan.coleman at cwis.biz <mailto:ryan.coleman at cwis.biz>> wrote:
>> I’m having a complete brain fart today… I cannot come up with how to pull this off for some reason - and my google-fu is weak right now, to boot.
>> 
>> I need to turn a directory search (folder only, no files) and then take ones that have “.SPAM.” in the path and pipe that into a command…
>> 
>> So this:
>> >       /var/mail/vhosts/domain.ltd/user.name/.SPAM.New <http://user.name/.SPAM.New>
>> 
>> 
>> Needs to become this:
>> >       /usr/bin/sa-learn --progress --spam /var/mail/vhosts/domain.ltd/user.name/.SPAM.New/* <http://user.name/.SPAM.New/*>
>> >       /bin/mv /var/mail/vhosts/domain.ltd/user.name/.SPAM.New/cur/* <http://user.name/.SPAM.New/cur/*> /var/mail/vhosts/domain.ltd/user.name/.SPAM.Scanned/cur/* <http://user.name/.SPAM.Scanned/cur/*>
>> 
>> And I’d like to have it in a bash or sh script that I can put into CRON.
>> Additional want: Change emails to read status. I realize that’s another step for the files involved and it could easily be skipped.
>> 
>> Thanks!
>> 
>>>> Ryan
>> _______________________________________________
>> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
>> tclug-list at mn-linux.org <mailto:tclug-list at mn-linux.org>
>> http://mailman.mn-linux.org/mailman/listinfo/tclug-list <http://mailman.mn-linux.org/mailman/listinfo/tclug-list>
>> _______________________________________________
>> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
>> tclug-list at mn-linux.org <mailto:tclug-list at mn-linux.org>
>> http://mailman.mn-linux.org/mailman/listinfo/tclug-list
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20150321/972c9b66/attachment.html>