2 # m17n-db -- print information about the m17n database.
3 # Copyright (C) 2004, 2005
4 # National Institute of Advanced Industrial Science and Technology (AIST)
5 # Registration Number H15PRO112
6 # See the end for copying conditions.
13 echo "Usage: $0 [ OPTIONS ] [ TAG0 [ TAG1 [ TAG2 [ TAG3 ] ] ] ]"
15 echo " -h, --help Print this information."
16 echo " -v, --version Print the version number."
17 echo " -l, --locate Print absolute pathnames of database files."
18 echo " TAG0 through TAG3 specifies the tags of the database."
19 echo "With no options, print the installed directory name."
22 if test $# -gt 0; then
24 -h | --help) help; exit 0;;
25 -v | --version) echo "@VERSION@"; exit 0;;
26 -l | --locate) DIRFILE="$datadir/m17n/mdb.dir"; shift;;
31 if test -z "$DIRFILE" ; then
36 if test ! -f "$DIRFILE"; then
37 echo "Can't find the m17n database directory file \"$DIRFILE\"!"
48 if test -z "$TAG1"; then
52 if test -z "$TAG2"; then
56 if test -z "$TAG3"; then
61 ANY="$SPC\([A-Za-z*][^ )]*\)\?"
63 TAGS="$SPC\($TAG0\)$SPC$ANY$SPC$ANY$SPC$ANY"
64 FILE="$SPC\"\([^\"]*\)\""
65 ENTRIES=`sed -n "/$TAG0/s|$SPC($TAGS$FILE).*$|/\1/\2/\3/\4/\5|p" $DIRFILE`
70 FN=`expr "$e" : "/[^/]*/[^/]*/[^/]*/[^/]*/\(.*\)"`
72 /$TAG0/\*/*/* | /$TAG0/*/\*/* | /$TAG0/*/*/\*)
75 ENTRY=`sed -n "/$TAG0/s|$SPC($TAGS).*$|/\1/\2/\3/\4|p" $f`
76 if test -n "$ENTRY"; then
77 LIST="$LIST $ENTRY/$f"
90 /$TAG0/$TAG1/$TAG2/$TAG3)
91 FN=`expr "$l" : "/[^/]*/[^/]*/[^/]*/[^/]*/\(.*\)"`
99 /***en @page m17n-db Print information about the m17n database */
100 /***ja @page m17n-db m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¾ðÊó¤òɽ¼¨ */
103 @section m17n-db-synopsis SYNOPSIS
105 m17n-db [ OPTIONS ] [ TAG0 [ TAG1 [ TAG2 [ TAG3 ] ] ] ]
107 @section m17n-db-description DESCRIPTION
109 The shell script m17n-db prints information about the m17n database.
111 The arguments OPTIONS has the following meanings.
114 Print this information.
116 Print the version number.
118 Print absolute pathnames of database files.\n
119 TAG0 through TAG3 specifies the tags of the database.
121 With no arguments, print where the m17n database is installed. */
125 # National Institute of Advanced Industrial Science and Technology (AIST)
126 # Registration Number H15PRO112
128 # This file is part of the m17n database; a sub-part of the m17n
131 # The m17n library is free software; you can redistribute it and/or
132 # modify it under the terms of the GNU Lesser General Public License
133 # as published by the Free Software Foundation; either version 2.1 of
134 # the License, or (at your option) any later version.
136 # The m17n library is distributed in the hope that it will be useful,
137 # but WITHOUT ANY WARRANTY; without even the implied warranty of
138 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
139 # Lesser General Public License for more details.
141 # You should have received a copy of the GNU Lesser General Public
142 # License along with the m17n library; if not, write to the Free
143 # Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
144 # Boston, MA 02110-1301, USA.