summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipsk/contrib/whichinpath
blob: a45177bb212f94a04fcd1ed234e5ab70afc610e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
#
#  Useful with the backtick execution special; helps to find PostScript
#  files on TEXINPUTS.  Contributed by S. P. Q. Rahtz.
#
pathList=`echo ${TEXINPUTS:=.:/usr/local/tex/inputs}  | tr ':' ' '`
theFile=$1

for p in $pathList
do
	test -f $p/$theFile && { echo $p/$theFile; exit 0; }
done
exit 1