#!/bin/sh
#
# xzf  [pattern] .....
#
# gerry.tomlinson@ncl.ac.uk (Apr 28 1993)
#
# filter to put at the end of an xzap command pipeline,
# removes all but the ps/sps header line and lines which match
# any of the pattern arguments, if no arguments then removes no
# lines at all except ones that match self.
# 

case $# in
0)	comm='sed -e /'`basename $0`'/d';;
*)	comm='sed -n -e /'`basename $0`'/d -e /PID/p -e /Proc#/p'

	for i
	do
		comm="$comm -e /$i/p"
	done
	;;
esac
eval $comm
