ShadowArch/Shared/standardize-folder
2016-11-09 22:25:00 -06:00

12 lines
293 B
Bash
Executable File

#!/bin/bash
export IFS="
"
export prefix="$(echo $PWD | rev | cut -f 1 -d '/' | rev)"
firstext="$(ls | head -n 1 | rev | cut -f 1 -d \. | rev)"
export count=1;
for i in $(ls -tr *."$firstext" | grep -v "$prefix"); do
mv "$i" "$prefix $count.$firstext"
export count=$(($count+1))
done