#!/bin/bash
# Time of last access
# Time of last modification
# Time of last change
FILE="$1"
# 判断是否带有参数
if [ $# -eq 0 ]
then
echo "$0 file-name"
exit 1
fi
which stat > /dev/null
# 查看是否安装有stat
if [ $? -eq 1 ]
then
echo "stat command not found!"
exit 2
fi
# 判断文件是否存在
if [ ! -e $FILE ]
then
echo "$FILE not a file"
exit 3
fi
# 用stat得到文件的相关信息
echo "Time of last access : $([......]