mirror of
https://codeberg.org/scip/dbtool.git
synced 2025-12-16 10:50:58 +01:00
22 lines
453 B
Plaintext
22 lines
453 B
Plaintext
|
|
#!/bin/sh
|
||
|
|
#
|
||
|
|
# simple locate alike
|
||
|
|
# written as an example how to
|
||
|
|
# use dbtool.
|
||
|
|
#
|
||
|
|
# updatedb creates the database
|
||
|
|
# which is then used by locate
|
||
|
|
# to search for a certain string.
|
||
|
|
#
|
||
|
|
# $Id: updatedb,v 1.2 2001/06/26 23:00:02 scip Exp $
|
||
|
|
#
|
||
|
|
|
||
|
|
dbtool="/usr/bin/dbtool";
|
||
|
|
find="/usr/bin/find";
|
||
|
|
db="/var/local/locate.db";
|
||
|
|
egrep="/bin/egrep";
|
||
|
|
cp="/bin/cp"
|
||
|
|
|
||
|
|
$cp /dev/null $db;
|
||
|
|
$find / -ls | $egrep -v "^\/proc|dev|tmp" | $dbtool -d $db -i -f -R -t "^(.+?) (\/.*)$";
|