#!/bin/bash read -p "Ingrese un prefijo: " pref read -p "Ingrese numero de inicio: " num read -p "Renombrar o copiar: (r/c) " opcion #Si no ingreso el prefijo o el numero, sale: if test -s $pref -o -s $num then echo "Error" exit 10 else for arch in *.jpg do if [ "$opcion" = "r" ] then mv "$arch" "$pref$num.jpg" else cp "$arch" "$pref$num.jpg" fi num=$(($num+1)) done fi