Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 May 1998 10:35:36 +0200 (CEST)
From:      blank@fox.uni-trier.de (Sascha Blank)
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   ports/6526: german/dict-1.1 port: script dict always fails
Message-ID:  <199805050835.KAA01495@sliphost37.uni-trier.de>

next in thread | raw e-mail | index | archive | help

>Number:         6526
>Category:       ports
>Synopsis:       german/dict-1.1 port: script "dict" always fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May  5 10:30:02 PDT 1998
>Last-Modified:
>Originator:     Sascha Blank
>Organization:
>Release:        FreeBSD 2.2.6-STABLE i386
>Environment:

The german/dict-1.1 port.  The file dict.sh has no RCS id, therefore I
will use its md5 sum to identify it:

MD5 (dict.sh) = 07d395673a98b2e44817ed15c2474d38

>Description:

Whenever I call the script like "dict Katze" or "dict Buch" it fails
with these error messages:

agrep: illegal option  -usage: agrep [-#cdehiklnpstvwxBDGIS] [-f patternfile] pattern [files]
summary of frequently used options:
-#: find matches with at most # errors
-c: output the number of matched records
-d: define record delimiter
-h: do not output file names
-i: case-insensitive search, e.g., 'a' = 'A'
-l: output the names of files that contain a match
-n: output record prefixed by record number
-v: output those records containing no matches
-w: pattern has to match as a word, e.g., 'win' will not match 'wind'
-B: best match mode. find the closest matches to the pattern
-G: output the files that contain a match
Nothing found, try best match mode
agrep: illegal option  -usage: agrep [-#cdehiklnpstvwxBDGIS] [-f patternfile] pattern [files]
summary of frequently used options:
-#: find matches with at most # errors
-c: output the number of matched records
-d: define record delimiter
-h: do not output file names
-i: case-insensitive search, e.g., 'a' = 'A'
-l: output the names of files that contain a match
-n: output record prefixed by record number
-v: output those records containing no matches
-w: pattern has to match as a word, e.g., 'win' will not match 'wind'
-B: best match mode. find the closest matches to the pattern
-G: output the files that contain a match

>How-To-Repeat:

Try the examples above yourself.

>Fix:

The problem is that agrep is called with an incorrect paramater.
Instead of using a single hyphen the "-e" option should be used in order
to make it possible to search for words that start with a hyphen
themselves.

The following small patch solves the problem for me:

*** dict.sh.orig	Tue May  5 10:15:51 1998
--- dict.sh	Tue May  5 10:26:14 1998
***************
*** 22,32 ****
      PAGER=cat
  fi
  
! if $agrep $agrep_opt - $1 $dict; then 
      :
  else
      echo "Nothing found, try best match mode" >&2
!     $agrep $agrep_opt -B - $1 $dict
  fi | perl -ne '($en, $de) = split(/\s*::\s*/);
  	  print sprintf("%-35s %s", $en, $de);' | $PAGER
  
--- 22,32 ----
      PAGER=cat
  fi
  
! if $agrep $agrep_opt -e $1 $dict; then 
      :
  else
      echo "Nothing found, try best match mode" >&2
!     $agrep $agrep_opt -B -e $1 $dict
  fi | perl -ne '($en, $de) = split(/\s*::\s*/);
  	  print sprintf("%-35s %s", $en, $de);' | $PAGER
  
--
             Sascha Blank            | "I prefer to work behind the scenes. The
   Student and System Administrator  | reward is nearly as great,  and the risk
 at the University of Trier, Germany | is far far less" - Ambassador Mollari in
    mailto:blank@fox.uni-trier.de    | in Babylon 5, "The coming of shadows"
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805050835.KAA01495>