Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 505c1f43dab36822baa29597f3b4cfc2 > files > 13

dbtool-1.6-6mdv2010.0.i586.rpm

#!/bin/sh
#
# simple locate alike
# written as an example how to
# use dbtool.
#
# locate searches the database
# for a file which matches a
# certain string. The parameter
# to locate can be a fully perl-
# compliant regular expression.
#
# $Id: locate,v 1.3 2001/06/26 23:00:02 scip Exp $

dbtool="/usr/bin/dbtool";
find="/usr/bin/find";
db="/var/local/locate.db";
sort="/bin/sort";
regex=$1;

if [ "x$regex" != "x" ]; then
    $dbtool -d $db -S -k $regex -w -R;
else
    echo "Usage: locate <expression>";
fi