#!/bin/sh


function recur {
	echo $@
	bpdir -M pa01pfil05 "$@" | while read line
	do
		#echo "[$line]"
		if [ -n "`echo $line | grep '\.pst$'`" ]
		then
			echo $line
		elif [ -n "`echo $line | grep '<dir>'`" ]
		then
			next=`echo $line | \
				sed -e 's,^[0-9/]* [0-9:]* *<dir> ,,'`
			[ -n "`echo $next | egrep -v '^\.$|^\.\.$'`" ] && recur "${@}/${next}"
		fi
	done
}

recur $@

