# fm-mass-rename # rename files programmatically or systematically with the help of # $EDITOR # ls isn't safe, but if filenames contain newlines we have bigger # problems originals=$(mktemp) ls > "$originals" modified=$(mktemp) cat > "$modified" <> "$modified" ${EDITOR:-nvim} "$modified" # remove comments from $modified sed -i /^#/d "$modified" # check if both are the same length -- if not, something's wrong original_len=$(wc -l $originals | cut -d' ' -f1) modified_len=$(wc -l $modified | cut -d' ' -f1) if [ "$original_len" -ne "$modified_len" ]; then cat <