mirror of
https://codeberg.org/scip/dbtool.git
synced 2025-12-17 19:30:58 +01:00
22 lines
383 B
Bash
Executable File
22 lines
383 B
Bash
Executable File
#!/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.
|
|
#
|
|
|
|
db="/var/db/locate.db"
|
|
regex=$1
|
|
|
|
if test -n "$regex"; then
|
|
dbtool -d $db -S -k $regex -w -R
|
|
else
|
|
echo "Usage: locate <expression>"
|
|
fi
|