grep, maybe

Ben Scott dragonhawk at gmail.com
Thu Oct 29 16:41:15 EDT 2009


On Thu, Oct 29, 2009 at 2:31 PM, Ken D'Ambrosio <ken at jots.org> wrote:
> find -type d | while read i
> do
> grep moe "$i/*" && mv "$i" /path/to/destination || echo "mv didn't work: $?"
> done

  Hmmm, does the "find" execute concurrently with the "grep"?  If it
does, then you're liable to confuse the hell out of "find" if you
manage to move a directory which is a component of the path it's
currently trasversing.

-- Ben


More information about the gnhlug-discuss mailing list