#!/bin/sh

homedir() {
	eval echo ~$1
}

filedate()  {
	ls -ld$2 $1|awk '{ print $6,$7,$8; }'
}

if [ -z "$1" ]; then
	echo "Usage: $0 username"
	exit 1
fi

FORMAT="%-20s  %-12s  %-12s  %-12s\n"
printf "$FORMAT" "Filename" "mtime" "ctime" "atime"
printf "$FORMAT" "--------" "-----" "-----" "-----"

if ! cd `homedir $1`; then
	echo "$1's home directory does not exist"
	exit 1
fi

for f in *; do
	printf "$FORMAT" "$f" "`filedate "$f"`" "`filedate "$f" c`" "`filedate "$f" u`"
done

