for loop - Bulk rename files ascending in number -


I have a file named 5000.swf and one of the .swf files in another folder The group is random name now I want to change the name of each file in the folder with random names (for example word.swf 5001.swf to otherword.swf to 5002.swf and so on. Is it possible with .sh script?

This is a method using BASH:

  # ! / Bin / sh counter = "$ (Basename /path/to/file/5000.swf" .swf ")" for I /path/to/random/files/*.swf; Switch to ((counter ++)) MV "$ i" "$ counter.swf"; a  

Comments

Popular posts from this blog

mysql - How to enter php data into a html multiple select box -

java - Can't add JTree to JPanel of a JInternalFrame -

c++ - Cassandra datastax cpp driver - avoiding unnecessary copies -