#!/bin/sh
#
# 'untouch' shell script created 
# on Tue Nov 22 20:58:30 MST 2011
#
# ENVIRONMENT:
#   TZ=US/Mountain; export TZ
#
# COMMANDS:
#   cd /home/markb/src/els/release/1.50e4/els-1.50e4
#   els +v=1.50 +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  2368572302 32172    20111122.202457  CHANGE_LOG
untouch  2976402821 1442     20080623.213929  INSTALL
untouch  1906020563 7295     20101022.180549  Makefile
untouch   838643347 5719     20090107.220647  NEWS
untouch  2644980290 251      20061101.004133  README
untouch  3681909039 5093     20100706.225508  TECH_NOTES
untouch   952274277 49862    20111117.195846  USER_GUIDE
untouch  4136359107 23332    20110829.201645  auxil.c
untouch   973742472 2568     20110829.201604  auxil.h
untouch  1975219697 7095     20080819.155737  chdate.1
untouch  2574165483 18241    20110829.204726  chdate.c
untouch  3865851092 14427    20080610.004446  cksum.c
untouch  2932259250 1695     20031009.193211  cksum.h
untouch  3047017686 13455    20110520.195559  config.c
untouch  1750196030 8122     20110520.192538  defs.h
untouch  2321399323 9370     20071219.190733  edate.1
untouch  2216950610 35715    20110829.205342  edate.c
untouch  1955838416 24321    20111117.193933  els.1
untouch   598156057 156353   20111122.204541  els.c
untouch   441631038 8670     20111117.182919  els.h
untouch   751363757 47135    20111117.180335  elsFilter.c
untouch  1893935695 2956     20110919.190310  elsFilter.h
untouch  1042459856 14753    20110519.014613  elsMisc.c
untouch  2199257699 1524     20050908.222815  elsMisc.h
untouch  1038989166 2083     20080609.233436  format.c
untouch  2434561743 5032     20110519.184617  format.h
untouch  4106665088 28421    20100310.192142  getdate32.c
untouch  2315992810 1455     20001018.200051  getdate32.h
untouch  2719621272 2835     20030130.164600  phLib.c
untouch  1178666143 1396     20020513.212333  phLib.h
untouch   903084701 9549     20110829.222235  quotal.c
untouch  3589372498 1208     20020507.163033  quotal.h
untouch  2572592699 3368     20080702.193425  sysInfo.c
untouch   828593629 1130     20041027.181357  sysInfo.h
untouch  3908426530 8553     20081028.170228  sysdefs.h
untouch  2238407687 5680     20080811.221049  sysdep.c
untouch  3468710274 1262     20080811.221112  sysdep.h
untouch  1097362515 11888    19991123.000645  time32.c
untouch  2302841894 1985     19970827.141331  time32.h
untouch  1648828723 981      20111122.205830  untouch
untouch  3415292104 232      20111122.204600  version.h
# EOF.
