#! /bin/bash

# Loop through all files in the current directory
FILECOUNT=1
for file in $(ls -rt input/*)
do
  # Get the file extension
  extension="${file##*.}"

  # Rename the file with the creation date and the original extension
  cp "$file" "output/$FILECOUNT.$extension"
  FILECOUNT=$(($FILECOUNT+1))
done
