On Wed, Sep 04, 2002 at 04:17:36PM -0400, Brian Ashe wrote:
> Wednesday, September 4, 2002, 3:59:19 PM, you textually orated:
> 
> BL> I am trying to rename a bunch of files with extension .inc to .php
> BL> in one fell-swoop.  Is there a set of commands I can pipe to each
> BL> other to do this like:
>  
> BL> ls *.inc | xargs ....
>  
> BL> or do I need to do a for loop. 

A for loop is certainly one way:

for i in $(ls *inc); do
  mv $i `basename $i inc`php;
done
unset i

> man rename

But obviously not the best or easiest way.  How is it I've used *nix for
all these years and never heard of this command?

-- 
They hang the man and flog the woman / That steal the goose from off the common,
But let the greater villain loose   / That steals the common from the goose.

 - English folk poem, circa 1764



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to