How to subtract 2 hours from 'date' in shell ( /bin/sh ) script ?

I write a sh script that zip and copy to tape all files that older then 2 hours.

  1. The way I choose is - touch a file with "now - 2 hours", then use fine with '! -newer'
  2. Do you have any other idea to do it ?
    tnx.

crewd but it works.

(host):# date +%Y-%m-%d-%H-%M-%S
2001-06-07-14-25-18
(host):# date +%Y-%m-%d-%H-%M-%S|awk -F"-" '{ print $1$2$3($4-2)$5$6 }'
20010607122522

or

OLDHOUR=`date +%H|awk '{ print ($1-2) }'`
FILES=`ls -l|grep -v total|awk '{ print $8 }'|awk -F":" '{ print $1 }'`
echo ${OLDHOUR}
echo ${FILES}

for i in `ls`;do
if [[ ${FILES} -le ${OLDHOUR} ]]; then
echo "This file ($i) is older then 2 hours from the current time"
fi
done
--- OUTPUT---
(host):# ./time.ksh
13
10 10 15 15 10
./time.ksh[6]: 10^J10^J15^J15^J10: syntax error

you would have to work out the FILES variable cuz there is a ^J in there and i dont know how to get rid of it. it seems to be comming from the -F option.