#!/bin/sh

set -eux

for f in "$@"; do
  # get modification time
  d=$(date -r "$f" +%Y%m%d)
  mkdir -p "$d"
  mv -f "$f" "$d"
done
