rm bashisms, applied port patch

This commit is contained in:
git@daemon.de
2015-05-16 00:14:14 +02:00
parent 30e1cdf87a
commit ad8681f0d1
6 changed files with 20 additions and 27 deletions

View File

@@ -11,14 +11,11 @@
# compliant regular expression.
#
dbtool="/usr/bin/dbtool";
find="/usr/bin/find";
db="/var/local/locate.db";
sort="/bin/sort";
regex=$1;
db="/var/db/locate.db"
regex=$1
if [ "x$regex" != "x" ]; then
$dbtool -d $db -S -k $regex -w -R;
if test -n "$regex"; then
dbtool -d $db -S -k $regex -w -R
else
echo "Usage: locate <expression>";
echo "Usage: locate <expression>"
fi

View File

@@ -9,11 +9,7 @@
# to search for a certain string.
#
dbtool="/usr/bin/dbtool";
find="/usr/bin/find";
db="/var/local/locate.db";
egrep="/bin/egrep";
cp="/bin/cp"
db="/var/db/locate.db";
$cp /dev/null $db;
$find / -ls | $egrep -v "^\/proc|dev|tmp" | $dbtool -d $db -i -f -R -t "^(.+?) (\/.*)$";
echo -n > $db
find / -ls | egrep -v "^\/proc|dev|tmp" | dbtool -d $db -i -f -R -t "^(.+?) (\/.*)$";