This file is indexed.

/usr/bin/gschemdoc is in geda-gschem 1:1.6.2-3.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
#!/bin/sh
# $Id$
#
# NOTE: built from gschemdoc.sh
#
# Present as relevant documentation as possible wrt a component
# The strategy is built into separate cases so that may be re-arranged easily
#
# arguments are:
#    1: "documentation" attribute, which can be a filename or an URL
#    2: "device" attribute
#    3: "value" attribute
#    4: symbol basename
#    5: symbol directory (currently not used)
#
# alternative action:
# present gschem user's manual, or a specific wiki page
#
# options:
#    "-m"              display user's manual instead
#    "-w <path>"       display a wiki page
#
# deBUG:
# echo "gschemdoc args are: <$0> <$1> <$2> <$3> <$4> <$5>"

#
# these may be changed to suit local preferences
#
CANDIDATE_BROWSER="xdg-open galeon mozilla phoenix netscape netscape-navigator opera firefox konqueror iexplore"
CANDIDATE_PDFREADER="xdg-open xpdf acroread ggv gv"
CANDIDATE_LOCATE="slocate locate"

#
# Information about the gEDA installation
#
DOCDIR="/usr/share/doc/geda-gaf"

# For OS X, since Linux has 'open' with different semantics
if [ "`uname -s`" = "Darwin" ]; then
	CANDIDATE_BROWSER="open $CANDIDATE_BROWSER"
	CANDIDATE_PDFREADER="open $CANDIDATE_PDFREADER"
fi

#
#  make symbol filename into something more akin to a device name
#
symbolbase=`echo "$4" | sed s/-[0-9]\\.sym//`

#
#  display file vith PDF viewer if file exists, it is a pdf file and we have a reader
#
view_file_if_pdf()
{
	# If we are on Cygwin, translate the path
	# so native applications can find the file
	if test "${cygpath}" != "no" ; then
		file=`cygpath -w $1`
	else
		file=$1
	fi

	if test -f "$1" && (file "$1" | grep -q "PDF") ; then
		if test "${pdfreader}" != "no"; then
			echo "Found ${pdfreader}"
			echo "Using PDF viewer and file: $file"
			# NOTE: Acrobat Reader on Windows does not seem to support
			#       -- on the command line
			${pdfreader} "$file"
			exit
		else
			echo "Did not find a PDF viewer application."
			exit
		fi
	fi
}

#
#  display file vith browser if available
#
view_file_browser()
{
	# If we are on Cygwin, translate the path
	# so native applications can find the file
	if test "${cygpath}" != "no" ; then
		file=`cygpath -w $1`
	else
		file=$1
	fi
	
	if test "${browser}" != "no" ; then
		echo "Found ${browser}"
		echo "Using browser and file: $file"
		# NOTE: Mozilla and Netscape does not seem to support
		#       -- on the command line
		"${browser}" "file://$file"
		exit
	else
		echo "Did not find a browser application."
		exit
	fi
}

#
#  go look for things globally
#
go_look_for()
{
	if test "${browser}" != "no" ; then
		echo "Go look for: $1"
		"${browser}" "http://www.google.com/search?q=$1%20filetype:pdf"
		exit
	else
		echo "Did not find a browser application."
		exit
	fi
}

#
#  display a manual of some kind
#
lookup_manual()
{
	if test -f "${DOCDIR}/$1" ; then
		view_file_browser "${DOCDIR}/$1"
	fi
	if test "${locate}" != "no"; then
		b=`${locate} -- "/$1"`
		if test `echo "$b" | wc -w` -ge 1; then
			view_file_browser "`echo "$b" | head -n1`"
		fi
	fi
	echo "Sorry, cannot show manual $1"
	exit 1
}

#
#  Display a wiki page
#
#  Tries a local page first; if it doesn't exist, falls back to wiki on gEDA 
#  website.
lookup_wiki()
{
    LOCALWIKIROOT="${DOCDIR}/wiki/"
    LIVEWIKIROOT="http://geda.seul.org/wiki/"

    # Munge wiki path to remove bad chars
    LOCALNAME=$(echo "$1" | tr "?\!*:" "___-")
    if test -z "$LOCALNAME"; then
	LOCALNAME="index"
    fi
    LOCALPATH="$LOCALWIKIROOT$LOCALNAME.html"

    LIVEURL="$LIVEWIKIROOT$1"

    if test -f "$LOCALPATH" ; then
	view_file_browser $LOCALPATH
	exit
    fi

    if test "${browser}" != "no" ; then
	
#       # Commented out, since the online wiki and the user version
#       # may not be the same.
#  
# 	echo "Found ${browser}"
# 	echo "Using browser and URL: $LIVEURL"
# 	# NOTE: Mozilla and Netscape does not seem to support
# 	#       -- on the command line
# 	${browser} "$LIVEURL"
	echo "Did not find the page in the local path."
	exit
    else
	echo "Did not find a browser application."
	exit
    fi
}


#
#  establish what software we have
#
browser="no"
for a in ${CANDIDATE_BROWSER}; do
	b=`which $a 2>/dev/null` && browser=$b && break
done

pdfreader="no"
for a in ${CANDIDATE_PDFREADER}; do
	b=`which $a 2>/dev/null` && pdfreader=$b && break
done

locate="no"
for a in ${CANDIDATE_LOCATE}; do
	b=`which $a 2>/dev/null` && locate=$b && break
done

cygpath="no"
b=`which cygpath 2>/dev/null` && cygpath=$b

#
#  documentation case first
#  NOTE: this is too crude..
#
if test "$1" = "-m"; then
	lookup_manual "gedadocs.html"
fi

#
#  try to load a specific wiki path
#
if test "$1" = "-w"; then
        lookup_wiki "$2"
fi

#
#  i.
#  if there is a file in the documentation directory, we
#  will of course use that first and foremost
#
if test "$1" != "" && test -f "${DOCDIR}/$1" ; then
	view_file_if_pdf "${DOCDIR}/$1"
	view_file_browser "${DOCDIR}/$1"
fi

#
#  ii.
#  if doc is an URL, we'll invoke the brower with that URL
#
if test "${browser}" != "no"; then
	for s in http ftp file; do
		if echo "$1" | grep -q "^$s:"; then
			echo "Found ${browser}"
			echo "Using browser and URL: $1"
			"${browser}" "$1"
			exit
		fi
	done
fi

#
#  iii.
#  if documentation is a filename, we'll invoke locate to see if we can
#  find it locally
#
if test "$1" != "" && test "${locate}" != "no"; then
	b=`${locate} -- "/$1"`
	if test `echo "$b" | wc -w` -ge 1; then
		n="`echo "$b" | head -n1`"
		view_file_if_pdf "$n"
		view_file_browser "$n"
	fi
fi

#
#  iv.
#  if there is a documentation at all, go look for it on the web
#
if test "$1" != ""; then
	go_look_for "$1"
fi

#
#  v.
#  if there is a device and a value, add .pdf or .PDF and look for local files
#
if test "$2" != "" && test "$3" != ""; then
	for s in .pdf .PDF; do
		view_file_if_pdf "${DOCDIR}/$2-$3$s"
	done
fi

#
#  vi.
#  if there is a device, add .pdf or .PDF and look for local files
#
if test "$2" != ""; then
	for s in .pdf .PDF; do
		view_file_if_pdf "${DOCDIR}/$2$s"
	done
fi

#
#  vii.
#  if there is a device and a value, go look for both on the web
#
if test "$2" != "" && test "$3" != ""; then
	go_look_for "$2%20$3"
fi

#
#  viii.
#  if there is a device only, go look for it on the web
#
if test "$2" != ""; then
	go_look_for "$2"
fi

#
#  ix.
#  if there is a value only, go look for it on the web
#
if test "$3" != "" && test "${browser}" != "no" ; then
	go_look_for "$3"
fi

#
#  x.
#  there is just a symbol filename - try to find a pdf locally
#
if test "${symbolbase}" != "" && test "${pdfreader}" != "no"; then
	for s in .pdf .PDF; do
		view_file_if_pdf "${DOCDIR}/${symbolbase}$s"
	done
fi

#
#  xi.
#  there is a device, go look for it on the web
#
if test "${symbolbase}" != ""; then
	go_look_for "${symbolbase}"
fi

#
#  none of the above
#
echo "Sorry, cannot help you"