#!/sbin/sh
#	@(#)filesearch.sh	13.3 (RC International) 91/10/10

#	Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T
#	  All Rights Reserved

#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
#	The copyright notice above does not evidence any
#	actual or intended publication of such source code.

#ident	"@(#)oamintf:files/bin/filesearch.sh	1.3"

# Remember to put search.text into a /tmp file 


fsys="${1}"
days="${2}"

if test  -d ${fsys}
	then
		cd ${fsys}
		flist=`find . -xdev -mtime +${days} -print`
		if test -z "${flist}"
		then
			echo "
   There are no files older than ${days} days in" `pwd` >/tmp/search.text
			exit 1
		else

echo "\nFILES NOT MODIFIED IN THE LAST ${days} DAYS IN `pwd`:\n
       	 file size   date of
owner   (characters) last access  filename
-----   ------------ ------------ --------" >/tmp/search.text
				echo ${flist} | xargs ls -dl  | cut -c15-23,30-54,57- | sort +5 >>/tmp/search.text
				echo >>/tmp/search.text
			exit 0
		fi

	else
		exit 1

fi
