Re: how to change file name in a batch mode?



Vilmos Soti <vilmos@xxxxxxx> writes:

Michael Goerz <news3@xxxxxxxxxxxxxxx> writes:

roy wrote:
I have thousands of files with extension name .php, I want to change
their extension to .cgi.
Is there any easy way to do that on linux?

perl can do the job. Try this:


#!/usr/bin/perl -w
use strict;
my @files = readpipe('ls *.php');

He has thousands of files. There is a chance that with many files
and long names, he will get back "argument list too long".

my @files = glob "*.php" ;
.



Relevant Pages