File: whichinpath

package info (click to toggle)
dvipsk-ja 5.98%2Bp1.7b-1.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 6,828 kB
  • ctags: 2,174
  • sloc: ansic: 20,418; sh: 10,423; makefile: 300; perl: 283; csh: 47
file content (13 lines) | stat: -rw-r--r-- 309 bytes parent folder | download | duplicates (26)
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