From owner-freebsd-bugs@FreeBSD.ORG Fri Dec 10 18:40:22 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6AE5E16A4E5 for ; Fri, 10 Dec 2004 18:40:22 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2FE1543D45 for ; Fri, 10 Dec 2004 18:40:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iBAIeMiG009426 for ; Fri, 10 Dec 2004 18:40:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id iBAIeMuV009425; Fri, 10 Dec 2004 18:40:22 GMT (envelope-from gnats) Resent-Date: Fri, 10 Dec 2004 18:40:22 GMT Resent-Message-Id: <200412101840.iBAIeMuV009425@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Diomidis Spinellis Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 15A1B16A4CE for ; Fri, 10 Dec 2004 18:31:35 +0000 (GMT) Received: from spiti.spinellis.gr (ppp10-adsl-109.ath.forthnet.gr [62.1.233.109]) by mx1.FreeBSD.org (Postfix) with ESMTP id A7AE543D5F for ; Fri, 10 Dec 2004 18:31:33 +0000 (GMT) (envelope-from dds@spiti.spinellis.gr) Received: from spiti.spinellis.gr (localhost [127.0.0.1]) by spiti.spinellis.gr (8.13.1/8.13.1) with ESMTP id iBAIVUID085680 for ; Fri, 10 Dec 2004 20:31:31 +0200 (EET) (envelope-from dds@spiti.spinellis.gr) Received: (from dds@localhost) by spiti.spinellis.gr (8.13.1/8.13.1/Submit) id iBAIVUh2085679; Fri, 10 Dec 2004 20:31:30 +0200 (EET) (envelope-from dds) Message-Id: <200412101831.iBAIVUh2085679@spiti.spinellis.gr> Date: Fri, 10 Dec 2004 20:31:30 +0200 (EET) From: Diomidis Spinellis To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/74926: look(1) will silently ignore input from non-disk based files. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Diomidis Spinellis List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2004 18:40:22 -0000 >Number: 74926 >Category: bin >Synopsis: look(1) will silently ignore input from non-disk based files. >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Dec 10 18:40:21 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Diomidis Spinellis >Release: FreeBSD 4.10-STABLE i386 >Organization: AUEB >Environment: System: FreeBSD spiti.spinellis.gr 4.10-STABLE FreeBSD 4.10-STABLE #8: Fri Oct 8 18:28:03 EEST 2004 dds@spiti.spinellis.gr:/vol/obj/vol/src/sys/SPITI i386 >Description: Look(1) will not work on non disk based files. The program's design relies on having its input in memory (via mmap). No provisions are made for files that can not be mmaped. >How-To-Repeat: look hyppo Fix: Performing a binary search on sequential input does not make sense. Therefore, either add code to perform a linear scan or map the look(1) invocation into an equivalent sed(1) command: # If -f y/:upper:/:lower:/ # Use the actual characters here # if -d s/[^:alnum:]//g # Always /^word/,${ /^word/!q p } Example: sed -ne 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;/^hyppo/,${;/^hyppo/!q;p;}' Release-Note: >Audit-Trail: >Unformatted: