Introducing the Official Useful Shell Scripts Thread.
When submitting useful shell scripts, please use this format:
Output:
Simple Name: ie "rename images"
Quick Description: "change image names to incremental four number list"
howto edit: Shouldn't take much to look at the above code to realize that if your images are .png's to change the *.jpg to .png (obviously you see another .jpg, if you'll want to change that too to or else your .pngs will be turned into .jpgs! and you'll also want to edit the %04d to change the amount of numbers created while naming.
Remember to always submit clean code and to run your
When submitting useful shell scripts, please use this format:
PHP:
Simple Name: "a simple name for easy finding"
Quick Description: "a quick description describing the function and purpose of your script"
[code]
#!/bin/bash
insert
your code
done
[/code]
howto: describe how to use/modify your script
Simple Name: ie "rename images"
Quick Description: "change image names to incremental four number list"
Code:
#!/bin/bash
a=1
for i in *.jpg; do
new=$(printf "%04d.jpg" ${a})
mv "${i}" "${new}"
let a=a+1
done
Remember to always submit clean code and to run your
You must be registered for see links
.
Last edited: