home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / shell / 3124 < prev    next >
Encoding:
Text File  |  1992-07-25  |  908 b   |  31 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!nih-csl!alw.nih.gov!chintam
  3. From: chintam@alw.nih.gov (Niranjan Chintam)
  4. Subject: check for time stamp in ksh
  5. Message-ID: <1992Jul24.192127.15710@alw.nih.gov>
  6. Sender: postman@alw.nih.gov (AMDS Postmaster)
  7. Organization: National Inst. of Health, DCRT, CSL
  8. Date: Fri, 24 Jul 1992 19:21:27 GMT
  9. Lines: 20
  10.  
  11. Is there a simple script which can check if a particular file has been updated on a give day.
  12.  
  13. I have written the following script is there any other way to do the same.
  14.  
  15. #!/usr/bin/ksh
  16.  
  17.    stamp=`ls -l $filename | awk '$7 ~ /.*:.*/ {print $5$6}'`
  18.    today=`date | awk '{print $2$3}'`
  19.    if [ "$stamp" != "$today" ]; then
  20.       ..........
  21.       ...........
  22.       ...........
  23.    fi
  24.  
  25.  
  26. Thanks 
  27.  
  28.  
  29. -- Niranjan Chintam                                            chintam@alw.nih.gov
  30.                                                National Inst. of Health, DCRT, CSL
  31.