home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / dvips583.zip / contrib.zip / dvips / contrib / whichinpath < prev   
Text File  |  1998-11-03  |  309b  |  14 lines

  1. #!/bin/sh
  2. #
  3. #  Useful with the backtick execution special; helps to find PostScript
  4. #  files on TEXINPUTS.  Contributed by S. P. Q. Rahtz.
  5. #
  6. pathList=`echo ${TEXINPUTS:=.:/usr/local/tex/inputs}  | tr ':' ' '`
  7. theFile=$1
  8.  
  9. for p in $pathList
  10. do
  11.     test -f $p/$theFile && { echo $p/$theFile; exit 0; }
  12. done
  13. exit 1
  14.