]> code.delx.au - monosys/commitdiff
rename by date script
authorJames Bunton <jamesbunton@delx.net.au>
Mon, 23 Jul 2012 13:03:09 +0000 (23:03 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Mon, 23 Jul 2012 13:03:09 +0000 (23:03 +1000)
scripts/rename_by_date [new file with mode: 0755]

diff --git a/scripts/rename_by_date b/scripts/rename_by_date
new file mode 100755 (executable)
index 0000000..0dde55f
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+num=1
+ls -tr | while read f; do
+       mv "$f" "$num $f"
+       let "num=num+1"
+done
+