для файла в префиксе _ *. Tex; делать
file_new = echo "$file" | sed -e 's:\([0-9][0-9]\)\([0-9][0-9]\)\([0-9][0-9]\)\(\.tex\):\3\2\1\4:'
test "$ file"! = "$ file_new" && mv -f "$ file" "$ file_new"
сделано
Или, если у вас много файлов и / или вы хотите обрабатывать файлы рекурсивно, замените:
for file in Prefix_*.tex ; do
с:
find . -name Prefix_*.tex -print | while read file ; do
или (нерекурсивный, GNU):
find . -maxtdepth 1 -name Prefix_*.tex -print | while read file ; do