#!/bin/sh

# Checking to see if the output of the test scripts is the same as that for the
# reference log files is obscured by the differences in dates and file paths.
#
# This script filters out date strings and file paths from the input stream
# and replaces them with a canonical string.

# Example
#   % tFiltAudio | filter_log > new.log
#   % diff new.log tFiltAudio.log

# Editing:
# - Remove the file paths up to a "/test/" component
# - Remove dates of the form "1996/03/18".
# - Remove dates of the form "1996/03/18 12:34:59".
# - Remove dates of the form "May  3 12:34:59 1997"
# - For all except the last form, the date string must be surrounded by
#   blanks.
# - Dates in the 1970's and 1980's are not modified (such dates should not
#   occur in temporary files).
sed 's| /.*/test/| --path--/test/|;
	s| [12][90][^78][0-9]/[ 0-3][0-9]/[ 0-9][0-9] | YYYY/MM/dd |;
	s| [ 0-2][0-9]:[ 0-5][0-9]:[ 0-5][0-9] | hh:mm:ss |;
	s| [A-Z][a-z][a-z] [ 0-3][0-9] hh:mm:ss | MMM dd hh:mm:ss |;
	s| MMM dd hh:mm:ss [12][90][^78][0-9]| MMM dd hh:mm:ss YYYY|'

# $Id: filter_log 1.5 1997/05/05 libtsp-v3r0 $
