#!/bin/sh
#
# 'untouch' shell script created 
# on Wed Mar  9 17:24:10 MST 2016
#
# ENVIRONMENT:
#   setenv TZ US/Mountain
#
# COMMANDS:
#   cd /home/markb/src/els/release/1.53b2/els-1.53b2
#   els +v=1.53 +UR
#
# NB: Just because you are able to 'touch' a file doesn't necessarily mean
# that you can 'untouch' it.  The ability to untouch a file may require
# that you be the direct owner of the file or have super-user privileges.
#
# Save the following output into a script file so that it can then be run
# at a later time in order to recover file dates following a 'touch':
#

untouch()
{
   CKSUM=$1; SIZE=$2; DATE=$3; FILE="$4"
   [ -f "$FILE" ] && \
     [ `els +G%m +TI "$FILE"` != $DATE ] && \
       [ `els +G%s "$FILE"` = $SIZE ] && \
	 [ `els +C=posix +G%C "$FILE"` = $CKSUM ] && \
	   chdate -m $DATE "$FILE"
}

TZ=US/Mountain; export TZ

#          Checksum Size           Date       File
#        ---------- ----     ---------------  ----
untouch   751263374 40206    20160309.172402  CHANGE_LOG
untouch  2362941735 1448     20120719.202431  INSTALL
untouch  3670255406 8097     20160212.015510  Makefile
untouch   838643347 5719     20090107.220647  NEWS
untouch  2644980290 251      20061101.004133  README
untouch  3895474899 6677     20150902.190845  TECH_NOTES
untouch  2278013102 51086    20151013.234346  USER_GUIDE
untouch  4119243147 26670    20151124.195749  auxil.c
untouch  2808915452 2686     20150507.212839  auxil.h
untouch  1965883156 8624     20151013.233355  chdate.1
untouch  3322731839 22264    20160119.213541  chdate.c
untouch  2495617380 15839    20160106.182217  cksum.c
untouch   329116563 1537     20150910.005040  cksum.h
untouch  4100150853 16092    20160106.181937  config.c
untouch  1300157174 10599    20160308.223924  defs.h
untouch   234897840 11372    20151013.233330  edate.1
untouch  3918458654 40011    20160119.213614  edate.c
untouch   135948617 25904    20151013.234458  els.1
untouch   869620189 163222   20160308.005739  els.c
untouch  1201437963 9436     20150923.204137  els.h
untouch  1990739830 49675    20151013.234042  elsFilter.c
untouch  1893935695 2956     20110919.190310  elsFilter.h
untouch  4184377484 16477    20160308.235912  elsMisc.c
untouch   686762188 1689     20160308.005642  elsMisc.h
untouch   601172562 2187     20150910.191523  format.c
untouch   976368190 6768     20150910.192755  format.h
untouch  3967374756 35556    20151001.002354  getdate32.c
untouch  2315992810 1455     20001018.200051  getdate32.h
untouch  2719621272 2835     20030130.164600  phLib.c
untouch   203566356 1494     20150903.001801  phLib.h
untouch  3715712091 9941     20160308.004505  quotal.c
untouch  2324232619 1145     20121105.192924  quotal.h
untouch  4078121779 3716     20160106.181853  sysInfo.c
untouch   828593629 1130     20041027.181357  sysInfo.h
untouch  1988483681 9214     20131127.212253  sysdefs.h
untouch  2238407687 5680     20080811.221049  sysdep.c
untouch  3468710274 1262     20080811.221112  sysdep.h
untouch  1295281883 13447    20150909.212417  time32.c
untouch  1322778907 2032     19970827.141331  time32.h
untouch   456326503 975      20160309.172410  untouch
untouch  2726725249 228      20160309.172354  version.h
# EOF.
