#!/bin/bash # Rename canto files for file in *; do if [[ $file != r.sh ]]; then num="$(echo $file | tr -d -c 0-9)" pad="$(printf "%03d\n" $num)" echo "$file: $pad" mv $file "$pad-purgatorio.txt" fi done