#!/bin/bash

INDEX=0

find . -type f | while read FILE; do
	BASENAME=$(basename "$FILE")
	EXTENSION="${BASENAME##*.}"
	FILENAME="${BASENAME%.*}"

	echo "$FILENAME.$EXTENSION -> $INDEX.$EXTENSION"

	mv "$FILENAME.$EXTENSION" "$INDEX.$EXTENSION"

	INDEX=$((INDEX+1))
done