locate.sh revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1989-2011 AT&T Intellectual Property #
# and is licensed under the #
# Eclipse Public License, Version 1.0 #
# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
# #
# Information and Software Systems Research #
# AT&T Research #
# Florham Park NJ #
# #
# Glenn Fowler <gsf@research.att.com> #
# #
########################################################################
USAGE=$'
[-?
@(#)$Id: locate (AT&T Labs Research) 1999-01-23 $
]
[+NAME?locate - locate files in pathname database]
[+DESCRIPTION?\blocate\b matches file patterns in a pathname database
that is updated daily by \bupdatedb\b(1).]
[d:database?File database path.]:[path]
[i:ignorecase?Ignore case in all pattern match expressions.]
[n:show?Show underlying \btw\b(1) command but do not execute.]
pattern ...
[+OPERANDS]{
[+pattern?One or more file patterns.
/ is matched by pattern metacharacters.]
}
[+ENVIRONMENT]{
[+FINDCODES?Path name of locate database.]
[+LOCATE_PATH?Alternate path name of locate database.]
}
[+FILES]{
}
[+SEE ALSO?\bupdatedb\b(1), \btw\b(1)]
'
;;
*) ARGV0=""
USAGE="nd:[path] pattern ..."
;;
esac
usage()
{
OPTIND=0
exit 2
}
db=
opts=
show=
;;
;;
n) show="print --"
;;
*) usage
;;
esac
done
esac
?*) db="-F${db#:}" ;;
esac
shift $OPTIND-1
case $# in
0) usage
;;
1) ;;
*) pat=$1
while :
do shift
case $# in
0) break ;;
esac
done
set -- "$pat"
;;
esac