File: whichinpath

package info (click to toggle)
tetex-bin 2.0.2-30sarge5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 50,108 kB
  • ctags: 38,418
  • sloc: ansic: 295,045; cpp: 54,320; sh: 25,684; perl: 8,806; makefile: 3,892; yacc: 2,235; pascal: 1,381; awk: 1,103; asm: 851; lex: 833; lisp: 527; sed: 518; 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