Cover V03, I03
Article
Figure 1
Figure 2
Listing 1
Listing 10
Listing 11
Listing 12
Listing 13
Listing 14
Listing 2
Listing 3
Listing 4
Listing 5
Listing 6
Listing 7
Listing 8
Listing 9

may94.tar


Listing 14: yearago.sh

:
#######################################################
# yearago.sh - this script returns the decimal value for
# a 'year ago' in UNIX stat time.  first it creates a
# temp file in order to read the stat record and get
# today's time, then it subtracts 3,153,600 seconds from
# that amount and echos the value.  3,153,600 is the
# number of seconds in a year.

#  *  60 seconds in minute
#  *  60 minutes in an hour
#  *  24 hours in a day
#  * 365 days a year
#---------
# 31,536,000

# create temp file
fn=/tmp/tmp_$$ ; > $fn

# call stat to return the modification time in decimal
# form
x=`stat -M $fn`

# remove temp file
rm -f $fn

# subtract a year's worth of seconds to generate the
# UNIX time it would have been a year ago.
x=`expr $x - 31536000`

# display the value
echo $x

# uncomment the following line to see the time and date
# for a year ago.
# ctime $x

exit 0