Various/.efingerd

36 lines
1.1 KiB
Bash

#!/bin/sh
#
# A simple script to print your stuff on systems with the efingerd
# finger daemon.
#
# Usage: Put in your $HOME, create a dir named .finger and add your
# .plan, .project and wathever else to it. Keep in mind that
# files without a preseding period (.) will be ignored. This is
# by incompetence rather than design.
#
# Author: sndr@tilde.team
# License: public domain
#
FINGERDIR=/home/$3/.finger
FILES=$FINGERDIR/.*
for file in $FILES
do
if [[ $(basename $file) == "." || $(basename $file) == ".." ]]; then
:
else # This whole colon and else business is bonkers,
# but I could not for the life of me get it to work
# any other way.
if [ -s $file ]; then
echo $(basename $file)
sed 's/^/ /' $file
echo ""
else
echo $(basename $file)
echo " (empty file)"
echo ""
fi
fi
done