Bulk rename routines: Difference between revisions

From VistApedia
Jump to navigationJump to search
Created page with "To bulk rename routines, easiest to use the <code>rename</code> command. Use the -n flag to rename so that it won't do anything before you commit to renaming. <pre> $ rename ..."
 
(No difference)

Latest revision as of 02:01, 7 October 2015

To bulk rename routines, easiest to use the rename command. Use the -n flag to rename so that it won't do anything before you commit to renaming.

$ rename -n s/KBAIEHX/EHXPRE/ r/KBAIEHX*.m
$ rename -v s/KBAIEHX/EHXPRE/ r/KBAIEHX*.m

To rename the variables inside of the routines, you can use sed like this:

$ sed -i 's/KBAIEHX/EHXPRE/g' r/EHXPRE*.m