On Thu, Aug 11, 2011 at 7:17 PM,  <siegfr...@heintze.com> wrote:
> find /xyz -exec perl -e 'foreach(@ARGV){ my @p=split "/"; rename $_,
> "./$p[$#p].txt" } '

If I'm reading this right then it looks like you're trying to
recursively move all files in /xyz into the current directory.
Probably don't need Perl for that.

find /xyz -type f -execdir /bin/echo mv '{}' "`pwd`/{}.txt" \;

Remove the /bin/echo to actually execute it, but you should make
absolutely sure it does the Right Thing(tm) first. I haven't actually
executed it myself so I'm not 100% sure it does the right thing, but
the output looks correct.


-- 
Brandon McCaig <http://www.bamccaig.com/> <bamcc...@gmail.com>
V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl.
Castopulence Software <http://www.castopulence.org/> <bamcc...@castopulence.org>

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to