Re: changing suffix

Jean Richard <[email protected]>
Newsgroups gmane.user-groups.linux.ottawa.general
Message-ID <[email protected]>
>> I am trying tro change the suffix of files that end in .a.b to .b
>> I tried (to echo first):
>> for f in *\.a\.bl; do echo ${f#\.a\}.b; done
 > This may not be the cleanest way, but here is a script that will change
 > them...

Check out the rename utility (found in the perl package on debian)

{jean@lithium} ls
foo1.a  foo2.a  foo3.a
{jean@lithium} rename "s/$/.b/" *.a
{jean@lithium} ls
foo1.a.b  foo2.a.b  foo3.a.b

The first argument is the regex command that describes the change that 
you want to make.. (dig up rgb's oclug talk on regex's or search google 
for info).  The rest of the arguments are the files that you want to rename.

--
Jean
-- 
OCLUG general discussion list
[email protected]
http://oclug.on.ca/mailman/listinfo/oclug
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.