Created
November 22, 2012 12:30
-
-
Save ichramm/4130950 to your computer and use it in GitHub Desktop.
UK Top 40 Singles Chart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# itera sobre los archivoss de una carpeta | |
# se fija si el archivo arranca con un numero | |
# si arranca con un numero se lo quita | |
# usado para quitar los duplicados de los UK Top 40 | |
# lo que hago es mover todos a una unica carpeta, sin lo numeros porque, por lo general, estan en distinta posicion de semana a semana | |
# | |
ext="*"; | |
if [ "$#" -gt 0 ]; then | |
ext=$1; | |
fi | |
find *.$ext -type f | while read file; do | |
first2=$(expr substr "$file" 1 2) | |
if [ "$first2" -eq "$first2" 2> /dev/null ]; then | |
mv -v "$file" "${file:3}"; | |
else | |
echo "$file DOES NOT MATCH" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment