mirror of
https://codeberg.org/scip/dbtool.git
synced 2025-12-19 12:20:57 +01:00
migrated to github
This commit is contained in:
24
samples/locate/locate
Executable file
24
samples/locate/locate
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/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.
|
||||
#
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user