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

Re: auto-change filenames



*- On  5 Oct, Brian J. Stults wrote about "auto-change filenames"
> Could someone give me a sample script (perhaps bash or sed) to change a
> group of filenames from their original name to the same name preceeded
> by an exclamation point.  For example, changing the following filenames
> from:
> 
> test1.cnm
> test2.cnm
> 
> to 
> 
> !test1.cnm
> !test2.cnm
> 
> Thanks!
> 

Install the mmv package and read the man page, for your example above
the following should work.

mmv "*.cnm" "!#1.cnm"

-- 
Brian Servis
------------------------------------------------------------------------
Mechanical Engineering              |  Never criticize anybody until you  
Purdue University                   |  have walked a mile in their shoes,
servis@purdue.edu                   |  because by that time you will be a
http://www.ecn.purdue.edu/~servis   |  mile away and have their shoes.


Reply to: