From owner-freebsd-ports Tue May 5 10:32:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA29246 for freebsd-ports-outgoing; Tue, 5 May 1998 10:32:42 -0700 (PDT) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA29212 for ; Tue, 5 May 1998 10:32:37 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id KAA04290; Tue, 5 May 1998 10:30:02 -0700 (PDT) Received: from sliphost37.uni-trier.de (blank@sliphost37.uni-trier.de [136.199.240.37]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA28167 for ; Tue, 5 May 1998 10:29:06 -0700 (PDT) (envelope-from blank@sliphost37.uni-trier.de) Received: (from blank@localhost) by sliphost37.uni-trier.de (8.8.8/8.8.8) id KAA01495; Tue, 5 May 1998 10:35:36 +0200 (CEST) (envelope-from blank) Message-Id: <199805050835.KAA01495@sliphost37.uni-trier.de> Date: Tue, 5 May 1998 10:35:36 +0200 (CEST) From: blank@fox.uni-trier.de (Sascha Blank) Reply-To: blank@fox.uni-trier.de To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: ports/6526: german/dict-1.1 port: script dict always fails Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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