diff options
author | wosch <wosch@FreeBSD.org> | 1998-03-08 15:28:37 +0000 |
---|---|---|
committer | wosch <wosch@FreeBSD.org> | 1998-03-08 15:28:37 +0000 |
commit | 583f1a9569485e7836389a9a82695293fcf808d3 (patch) | |
tree | 9841cd614f4e4c9fbe2c946b025faec6eed5519d /usr.bin/locate | |
parent | abd50d80bbe9d46e06402d308fbe010ed26f7e33 (diff) | |
download | FreeBSD-src-583f1a9569485e7836389a9a82695293fcf808d3.zip FreeBSD-src-583f1a9569485e7836389a9a82695293fcf808d3.tar.gz |
Improve shell variable substitution.
Diffstat (limited to 'usr.bin/locate')
-rw-r--r-- | usr.bin/locate/locate/concatdb.sh | 18 | ||||
-rw-r--r-- | usr.bin/locate/locate/mklocatedb.sh | 16 | ||||
-rw-r--r-- | usr.bin/locate/locate/updatedb.sh | 20 |
3 files changed, 24 insertions, 30 deletions
diff --git a/usr.bin/locate/locate/concatdb.sh b/usr.bin/locate/locate/concatdb.sh index dd16230..66f2cfb 100644 --- a/usr.bin/locate/locate/concatdb.sh +++ b/usr.bin/locate/locate/concatdb.sh @@ -30,25 +30,23 @@ # # Sequence of databases is important. # -# $Id: concatdb.sh,v 1.5 1997/02/22 19:55:45 peter Exp $ +# $Id: concatdb.sh,v 1.6 1997/12/13 18:18:07 sef Exp $ # The directory containing locate subprograms -: ${LIBEXECDIR=/usr/libexec}; export LIBEXECDIR +: ${LIBEXECDIR:=/usr/libexec}; export LIBEXECDIR PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; export PATH umask 077 # protect temp files -TMPDIR=${TMPDIR:-/tmp}; export TMPDIR; -if test X"$TMPDIR" = X -o ! -d "$TMPDIR"; then - TMPDIR=/tmp; export TMPDIR -fi +: ${TMPDIR:=/tmp}; export TMPDIR; +test -d "$TMPDIR" || TMPDIR=/tmp # utilities to built locate database -: ${bigram=locate.bigram} -: ${code=locate.code} -: ${sort=sort} -: ${locate=locate} +: ${bigram:=locate.bigram} +: ${code:=locate.code} +: ${sort:=sort} +: ${locate:=locate} case $# in diff --git a/usr.bin/locate/locate/mklocatedb.sh b/usr.bin/locate/locate/mklocatedb.sh index 4021dfc..30839a2 100644 --- a/usr.bin/locate/locate/mklocatedb.sh +++ b/usr.bin/locate/locate/mklocatedb.sh @@ -28,25 +28,23 @@ # # usage: mklocatedb [-presort] < filelist > database # -# $Id: mklocatedb.sh,v 1.4 1997/02/22 19:55:49 peter Exp $ +# $Id: mklocatedb.sh,v 1.5 1997/12/13 18:18:10 sef Exp $ # The directory containing locate subprograms -: ${LIBEXECDIR=/usr/libexec}; export LIBEXECDIR +: ${LIBEXECDIR:=/usr/libexec}; export LIBEXECDIR PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; export PATH umask 077 # protect temp files -TMPDIR=${TMPDIR:-/tmp}; export TMPDIR -if test X"$TMPDIR" = X -o ! -d "$TMPDIR"; then - TMPDIR=/tmp; export TMPDIR -fi +: ${TMPDIR:=/tmp}; export TMPDIR +test -d "$TMPDIR" || TMPDIR=/tmp # utilities to built locate database -: ${bigram=locate.bigram} -: ${code=locate.code} -: ${sort=sort} +: ${bigram:=locate.bigram} +: ${code:=locate.code} +: ${sort:=sort} sortopt="-u -T $TMPDIR" diff --git a/usr.bin/locate/locate/updatedb.sh b/usr.bin/locate/locate/updatedb.sh index d0e4b62..79d5538 100644 --- a/usr.bin/locate/locate/updatedb.sh +++ b/usr.bin/locate/locate/updatedb.sh @@ -26,7 +26,7 @@ # # updatedb - update locate database for local mounted filesystems # -# $Id: updatedb.sh,v 1.7 1997/02/22 19:55:49 peter Exp $ +# $Id: updatedb.sh,v 1.8 1997/12/13 18:18:12 sef Exp $ LOCATE_CONFIG="/etc/locate.rc" if [ -f "$LOCATE_CONFIG" -a -r "$LOCATE_CONFIG" ]; then @@ -34,21 +34,19 @@ if [ -f "$LOCATE_CONFIG" -a -r "$LOCATE_CONFIG" ]; then fi # The directory containing locate subprograms -: ${LIBEXECDIR=/usr/libexec}; export LIBEXECDIR -TMPDIR=${TMPDIR:-/tmp}; export TMPDIR -if test X"$TMPDIR" = X -o ! -d "$TMPDIR"; then - TMPDIR=/tmp; export TMPDIR -fi +: ${LIBEXECDIR:=/usr/libexec}; export LIBEXECDIR +: ${TMPDIR:=/tmp}; export TMPDIR +test -d "$TMPDIR" || TMPDIR=/tmp PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; export PATH -: ${mklocatedb=locate.mklocatedb} # make locate database program -: ${FCODES=/var/db/locate.database} # the database -: ${SEARCHPATHS="/"} # directories to be put in the database +: ${mklocatedb:=locate.mklocatedb} # make locate database program +: ${FCODES:=/var/db/locate.database} # the database +: ${SEARCHPATHS:="/"} # directories to be put in the database : ${PRUNEPATHS="/tmp /usr/tmp /var/tmp"} # unwanted directories -: ${FILESYSTEMS="ufs"} # allowed filesystems -: ${find=find} +: ${FILESYSTEMS:="ufs"} # allowed filesystems +: ${find:=find} case X"$SEARCHPATHS" in X) echo "$0: empty variable SEARCHPATHS"; exit 1;; esac |