#!/bin/csh -f # # Set file's timestamp to 24 hours ago. # (Based totally on touch-24.) # # Written for MacOSX. # (Does not work on Solaris-10, where # date does not support "+%s" or "-r".) # # Brent Chivers 2010 Jun 21 unalias * # get other users' .cshrc stuff out of the way set seconds = `date '+%s'` # seconds since the epoch @ yesterday = $seconds - 21600 # seconds 6 hours earlier (6 * 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