#!/bin/sh
#
#  edigrep -- use Edith as an alternative to `fgrep', automatically
#             loading files with the cursor pointing at the first
#             occurrence of the searched target string.
#
#  This  file is (C) 1997 Annius Groenink/ZFC,  and is part of the Edith
#  Pro for X11 package.  Not to be distributed separately.
#

if [ "$DISPLAY" = "" ]
then
   if [ "$EDITOR" = "" -o "$EDITOR" = "edivisual" ]
   then
      EDITOR="vi"
   fi

   $EDITOR `fgrep -l $* | uniq`
else
   `fgrep -l $* | uniq | awk 'BEGIN{ printf("edith "); } { printf("%s:/%s ", $0, a); } END{ printf("\n"); }' a=$1 -`
fi
