3 # loc Find a class or package
5 # Usage: loc [-l] class-pattern [dirname]
7 # -l Use system locate command instead of find. In that case, loc
8 # will ignore any directory to be searched.
12 # $ loc -l org.objectweb.jonas.common.JProp
13 # /var/lib/jonas/demoserver/ejbjars/autoload/mejb.jar
14 # /var/lib/jonas/lib/common/ow_jonas_bootstrap.jar
15 # /var/lib/jonas/eclipseserver/ejbjars/autoload/mejb.jar
16 # /var/lib/jonas/ejbjars/autoload/mejb.jar
17 # /var/cache/jonas/work/ejbjars/jonas/mejb_2005.09.15-17.01.52.jar
18 # /usr/src/redhat/BUILD/jonas-4.3.3/jonas/classes/common/org/objectweb/jonas/common/JProp.class
22 if test "$MODE" == "-l"; then
23 COMMAND
='(locate \*.jar ; locate \*.war)'
26 COMMAND
='(find "$FOO" -name \*.jar -follow ; find "$FOO" -name \*.war -follow)'
30 if test "x$FOO" == "x"; then
34 eval "$COMMAND" 2>/dev
/null |
while read i
; do
35 if (fastjar tf
$i 2>/dev
/null |
grep $1) > /dev
/null
2>&1 ; then
40 if test "$MODE" != "-l"; then
41 find "$FOO" -name '*.class' 2>/dev
/null |
grep $1
43 locate \
*.class |
grep $1