On 12/08/2011 18:52, Rob Dixon wrote:
> On 12/08/2011 00:17, siegfr...@heintze.com wrote:
>> This works! Is there a way to do it with less typing? How can I do it
>> without creating a temporary variable "@p"?
>> Thanks,
>> siegfried
>>
>> find /xyz -exec perl -e 'foreach(@ARGV){ my @p=split "/"; rename $_,
>> "./$p[$#p].txt" } '
> 
> find /xyz -exec perl -e '/([^\/]+)\z/ and rename $_,"$1.txt" for @ARGV';

More accurately:

find /xyz -exec perl -e '/([^\/]+)\z/ and rename $_,"./$1.txt" for @ARGV'

Rob

-- 
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