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> 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
>
>
> Needs to become this:
> >       /usr/bin/sa-learn --progress --spam /var/mail/vhosts/domain.ltd/
> user.name/.SPAM.New/*
> >       /bin/mv /var/mail/vhosts/domain.ltd/user.name/.SPAM.New/cur/*
> /var/mail/vhosts/domain.ltd/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
> 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/d4acd0af/attachment.html>