RE: pattern matching rename...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



thanks todd...

at the risk of asking a rather basic question.. can someone explain exactly
what/why this seesm to work..

per your reply, i have :

 abcCAT.py
 abcCAT.txt

 i'd like to rename the files, so i get
 abcCAT_dog.py
 abcCAT_dog.txt

 i've been trying to figure out how to achieve what i want using
 rename and pattern matching.. i'm missing something.. and it's
 simple!!

 any thoughts/pointers?
$ rename . _dog. abcCAT.*
 ls abcCAT*
abcCAT_dog.py  abcCAT_dog.txt

this works. but i can't find any docs that give a good explanation of
how/why this works.

it appears that the rename is taking the "_dog" and adding it to the
"abcCAT"... but how would i know that this is going to occur.. is this
really what's going on.. what if i wanted to have the "_dog" added before
the abcCAT...

in searching the net (google) couldn't really find any good docs for this..

i was also under the impression that 'rename' could use regex's but i can't
figure out how..

thanks



-----Original Message-----
From: fedora-list-bounces@xxxxxxxxxx
[mailto:fedora-list-bounces@xxxxxxxxxx]On Behalf Of Todd Zullinger
Sent: Thursday, December 28, 2006 8:55 AM
To: fedora-list@xxxxxxxxxx
Subject: Re: pattern matching rename...


bruce wrote:
> i have the following as a test...
>
> abcCAT.py
> abcCAT.txt
>
> i'd like to rename the files, so i get
> abcCAT_dog.py
> abcCAT_dog.txt
>
> i've been trying to figure out how to achieve what i want using
> rename and pattern matching.. i'm missing something.. and it's
> simple!!
>
> any thoughts/pointers?

$ rename . _dog. abcCAT.*
$ ls abcCAT*
abcCAT_dog.py  abcCAT_dog.txt

Beware that there are different programs named rename on different
distros.

--
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
======================================================================
I believe in the noble, aristocratic art of doing absolutely nothing.
And someday, I hope to be in a position where I can do even less.


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux