• Source
    1. #
    2. # Accept filename and displays last modification time if file exists, otherwise display appropriate
    3. # message.
    4. #
    5. echo -n "Enter name of the file:"
    6. read filename
    7. if [ -f $filename ]
    8. then
    9. echo 'Last modification time is '`ls -lt $filename | tr -s " " "," | cut -d "," -f7`
    10. else
    11. echo "File not exist"
    12. fi