Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ $# -ne 1 ]
- then
- echo Numero de argumentos incorrecto.
- exit 1
- fi
- echo "Procesamos ficheros con extension '$1'."
- #Creamos la carpeta si no existe
- if [ ! -d "./$1" ]; then
- mkddir "./$1"
- fi
- #Procesamos los ficheros con la extension recibida
- contador=0
- for fichero in $( ls *.$1 ); do
- cp "$fichero" "./$1/$fichero"
- contador=$[ $contador + 1 ]
- done
- echo "Procesados &contador ficheros."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement