if [ $# -lt 2 ]
then
 (
  echo "$0: Insufficient arguments ($#)"
  echo "Usage: $0 original_file dir [dir ...]"
 ) 1>&2
 exit 1
fi

echo \$1 is $1
if [ ! -d $1 ]
then
 linkcount=`/bin/ls -l $1 | cut -c11-15`
 if [ $linkcount -eq 1 ]
 then
  echo "There are no links to this file." 1>&2
  exit 2
 fi
else
 (
 echo "The first argument needs to be a file name, NOT a directory."
 echo "Usage: $0 original_file dir [dir ...]"
 exit 3
 ) 1>&2
fi

echo "\nSearching for links to $1\n"
orig_inode=`ls -i $1 |cut -d" " -f1`
shift
for arg in $*
 do
  if [ -d $arg ]
  then
   for file in `find $arg -inum $orig_inode -print`
    do
     ll $file
    done
  fi
 done
