filename renaming

Normand Fisher <[email protected]>
Newsgroups gmane.user-groups.linux.ottawa.general
Message-ID <[email protected]>
I'd like to have a script to rename groups of files by including the 
directory name in the revised filename.

Ex:  in directory "A", I have files 1, 2, 3, 4, and 5.  
I would like to rename the files to A_1, A_2, A_3, A_4 and A_5.

To do this, I have so far used the "mmv" command but I still have to 
type in the directory name for each batch.  Is there a way to capture 
the directory name and place it in a variable?
I have looked at "pwd" but that gives me the whole path.

I don't mind using command line but I am not a programmer.  Any 
suggestion is welcome.

Normand
-- 
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.