#!/bin/csh -f # # Set file's timestamp to 24 hours ago. # # Written for MacOSX. # (Does not work on Solaris-10, where # date does not support "+%s" or "-r".) # # Brent Chivers 2006 Jan 13 # # Re-written for Linux. 2011/Jan/08 # Requires my date_name4 binary. unalias * # get other users' .cshrc stuff out of the way # set seconds = `date '+%s'` # seconds since the epoch # @ yesterday = $seconds - 86400 # seconds 24 hours earlier (24 * 60 * 60) # set date = `date -r $yesterday '+%Y%m%d%H%M.%S'` # convert seconds to touch string # touch -t $date $* # touch all files with yesterday's date/time set yyyymmdd = `/home/bchivers/bin/date_name4 = -1 | /usr/bin/tr -d =` set hhmmss = `/bin/date '+%H%M.%S'` /usr/bin/touch -t $yyyymmdd$hhmmss $*