Guzmán Castanedo Villalba 3 years ago
parent
commit
f393d3f8d8
1 changed files with 13 additions and 0 deletions
  1. 13 0
      addprefix

+ 13 - 0
addprefix

@@ -0,0 +1,13 @@
+#!/bin/bash
+# addprefix <prefix> <ext>
+
+SAVEIFS=$IFS
+IFS=$(echo -en "\n\b")
+prefix=$1
+ext=$2
+for i in $( ls *.$ext ); do
+	echo "Moving $i to $prefix$i"
+	mv $i $prefix$i
+done
+echo "Finished :)"
+IFS=$SAVEIFS