#!/bin/sh # (c) Christian Renz findPerl

 

findPerl


' # find out some system information SYSINFO=`$UNAME -a` if [ -z "$SYSINFO" ]; then echo "

$RED No system information found: $UNAME failed $NORED

" else echo "

System information (retrieved using $UNAME): $SYSINFO

" fi ### Searching for Perl ### echo "

Searching for perl interpreters installed on your system. This may take a few seconds.

" # Using locate... METHOD="$LOCATE / $GREP" PERLFOUND=`$LOCATE "$PERLSHEX" | $GREP "$PERLREGEX"` # Using which... if [ -z "$PERLFOUND" ]; then echo "

$RED $METHOD failed. $NORED Using $WHICH instead.

" METHOD="$WHICH" for i in $PERLNAMES; do # echo "Searching for '$i'...
" THISFOUND=`$WHICH $i` if [ "$THISFOUND" ]; then PERLFOUND="$PERLFOUND $THISFOUND" fi done fi # Using fallback paths... if [ -z "$PERLFOUND" ]; then echo "

$RED $METHOD failed. $NORED Using search in $FALLBACK instead.

" METHOD="search in $FALLBACK" for i in $FALLBACK; do for j in $PERLNAMES; do PERLFOUND="$PERLFOUND $i/$j" done done fi ### Find real perl interpreters ### REALPERL='' # $PERLFOUND probably contains some paths, man pages etc. # We are only interested in those files which are standard # files and executable for i in $PERLFOUND; do if [ -f "$i" -a -x "$i" ]; then REALPERL="$REALPERL $i" fi done ### Output information about perl interpreters ### if [ -z "$REALPERL" ]; then echo "

$RED Sorry, I was unable to find any perl interpreter.$NORED Probably something went horribly wrong. Contact your server administrator for assistance.

" else echo "

perl interpreters found using $METHOD:

" fi echo '
findPerl 0.1 beta - Copyright © 2001 Christian Renz - findPerl Homepage
' ### eof ###