[Ilugc] Shell tip : Renaming multiple files.

  • From: prataprc@xxxxxxxxx (Pratap Chakravarthy)
  • Date: Wed, 28 Dec 2011 11:22:35 +0530

I just copy pasted the command from my shell window :) since the files
are under version control (Hg) I had to use 'hg mv'

Cheers,

On Wed, Dec 28, 2011 at 10:13 AM, MohanR <mohan43u at gmail.com> wrote:

On Wed, 2011-12-28 at 08:05 +0530, Pratap Chakravarthy wrote:
$ for i in *.css; do hg mv "$i" "${i/.css}".tss ; done

do we need 'mercury' to rename a file? Isn't this just 'mv' instead of
'hg mv'?

Above command line is specific to renaming multiple files under
'mercury'.

We can rename multiple files using another method,

$ for FILE in *.css; do mv "${FILE}" "${FILE%.css}.tss"; done

Thanks,
Mohan R

_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc



-- 
Pratap.

Other related posts: