*BSD News Article 9895


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA6739 ; Tue, 12 Jan 93 15:12:19 EST
Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!caen!batcomputer!cornell!uw-beaver!newsfeed.rice.edu!rice!news.Rice.edu!rich
From: rich@Rice.edu (& Murphey)
Subject: Re: Locate/fast-find (Was: Re: Shared lib X for 386bsd?)
In-Reply-To: othman@ntrc25.ntrc.ntu.ac.sg's message of Fri, 15 Jan 1993 02:13:19 GMT
Message-ID: <RICH.93Jan13212555@superego.Rice.edu>
Lines: 70
Sender: news@rice.edu (News)
Reply-To: Rich@rice.edu
Organization: Department of Electrical and Computer Engineering, Rice
	University
References: <C0u7rz.158@news.chalmers.se> <1993Jan15.021319.23606@ntuix.ntu.ac.sg>
Date: Thu, 14 Jan 1993 03:25:55 GMT

>>>>> In article <1993Jan15.021319.23606@ntuix.ntu.ac.sg>, othman@ntrc25.ntrc.ntu.ac.sg (othman (EEE/Div 4)) writes:
Per Anders Olausson (pao@cd.chalmers.se) wrote:
: In article <carlp.726981966@frigg> carlp@frigg.isc-br.com (Carl Paukstis) writes:
: 
: >Anyhow - on both my home BSD system and some heavily-used SYSV development
: >systems I administer here at work, I run a little cron task every
: >night that does a "find / -print >/ALLfiles".  I've aliased "locate" to
: >a bash function that greps /ALLfiles.  It ain't up-to-the-minute, but
: >it beats fumbling around and waiting for interactive "find" sessions.
: 
: Please note that for 386bsd the proper way to handle this is to run:
: 
: 		/usr/libexec/locate.updatedb
othman> I tried running this but there are error messages:
othman> 
othman> # /usr/libexec/locate.updatedb
othman> sort: unrecognized option `-T'
othman> Usage: sort [-cmus] [-t separator] [-o output-file] [-bdfiMnr] [+POS1 [-POS2]]
othman>        [-k POS1[,POS2]] [file...]
othman> sort: unrecognized option `-T'
othman> Usage: sort [-cmus] [-t separator] [-o output-file] [-bdfiMnr] [+POS1 [-POS2]]
othman>        [-k POS1[,POS2]] [file...]
othman> sort: unrecognized option `-T'
othman> Usage: sort [-cmus] [-t separator] [-o output-file] [-bdfiMnr] [+POS1 [-POS2]]
othman>        [-k POS1[,POS2]] [file...]
othman> locate: updatedb failed
othman> 
othman> Anyone had patched this program.

Yep, this should fix it.  Rich

diff -c locate.updatedb.orig locate.updatedb
*** locate.updatedb.orig	Wed Jan 13 21:16:04 1993
--- locate.updatedb	Wed Jan 13 21:16:20 1993
***************
*** 1,4 ****
! #!/bin/csh -f
  #
  # Copyright (c) 1989 The Regents of the University of California.
  # All rights reserved.
--- 1,4 ----
! #!/bin/csh
  #
  # Copyright (c) 1989 The Regents of the University of California.
  # All rights reserved.
***************
*** 58,68 ****
  # find ${SRCHPATHS} -print | \
  find ${SRCHPATHS} ! -fstype local -a -prune -o -print | \
  	tr '/' '\001' | \
! 	(sort -T /var/tmp -f; echo $status > $errs) | tr '\001' '/' > $filelist
  
  $LIBDIR/locate.bigram < $filelist | \
! 	(sort -T /var/tmp; echo $status >> $errs) | \
! 	uniq -c | sort -T /var/tmp -nr | \
  	awk '{ if (NR <= 128) print $2 }' | tr -d '\012' > $bigrams
  
  # code the file list
--- 58,68 ----
  # find ${SRCHPATHS} -print | \
  find ${SRCHPATHS} ! -fstype local -a -prune -o -print | \
  	tr '/' '\001' | \
! 	(sort -f; echo $status > $errs) | tr '\001' '/' > $filelist
  
  $LIBDIR/locate.bigram < $filelist | \
! 	(sort ; echo $status >> $errs) | \
! 	uniq -c | sort -nr | \
  	awk '{ if (NR <= 128) print $2 }' | tr -d '\012' > $bigrams
  
  # code the file list