#!/bin/sh
cd $HOME/.DOTS/.passwd

# To check only files beginning with a dot are called .NOTES
#	find -s . -type f -name \.\* ! -name \.NOTES

if [ $#.x = 1.x ]
then
	echo "Single passwords not available, Use: passwords | grep $1"
else
	for i in `find -s . \( -type f -o -type l \) | \
			grep -v .NOTES | \
			grep -v httpuserfile | \
			grep -v hint | grep -v Distfile | \
			sed -e s/..// | sort`
		do
			if [ `wc -l < $i`.x = 1.x ]
			then
				# One line, as expected. Print 2 columns :
				#	name of file = login, & password
				printf "%-30s %s\n" $i "`cat $i`"
			else
				# some unusual file, print name, then
				# indent mutiple lines of content
				echo "$i:	"
				cat $i | sed -e 's/^/		/'
			fi
		done
fi
# echo "PATH=`pwd`"
# echo "`pwd`"
# The simpler below allows: cd `passwords | tail -1`
pwd
