"Fossies" - the Fresh Open Source Software Archive

Member "dbtool-1.9.1/samples/locate/updatedb" (15 May 2015, 306 Bytes) of package /linux/privat/dbtool-1.9.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "updatedb": 1.9_vs_1.9.1.

    1 #!/bin/sh
    2 #
    3 # simple locate alike
    4 # written as an example how to
    5 # use dbtool.
    6 #
    7 # updatedb creates the database
    8 # which is then used by locate
    9 # to search for a certain string.
   10 #
   11 
   12 db="/var/db/locate.db";
   13 
   14 echo -n > $db
   15 find / -ls | egrep -v "^\/proc|dev|tmp" | dbtool -d $db -i -f -R -t "^(.+?) (\/.*)$";