head 1.2; access; symbols SHTOOL_1_0_0:1.1.1.1 RSE:1.1.1; locks; strict; comment @# @; 1.2 date 99.04.29.11.21.06; author rse; state dead; branches; next 1.1; 1.1 date 99.04.29.11.19.34; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.04.29.11.19.34; author rse; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @## ## findperl -- Find a reasonable Perl interpreter ## Copyright (c) 1997-1999 Ralf S. Engelschall ## Originally written for ePerl ## Usage: findperl ## TMPFILE=/tmp/findperl.$$.tmp rm -f $TMPFILE touch $TMPFILE c=0 for dir in `echo $PATH | sed -e 's/:/ /g'`; do for perl in perl5 perl miniperl; do if test -f "$dir/$perl"; then perl="$dir/$perl" version=`$perl -v | grep version |\ sed -e 's/.* version //' -e 's/ built.*//' -e 's/ with.*//'` versionnum="`echo $version | sed -e 's/\.//g' -e 's/_//g'`" versionnum=`expr $versionnum - $c` echo "$versionnum $version $perl" >>$TMPFILE fi done c=`expr $c + 1` done perlvers="`cat $TMPFILE | sort -u | tail -1 | cut '-d ' -f2`" perlprog="`cat $TMPFILE | sort -u | tail -1 | cut '-d ' -f3`" rm -f $TMPFILE case $perlprog:$perlvers in *:5* ) ;; *:* ) echo "Ops, BnP needs an installed Perl 5.00x somewhere in $PATH" 1>&2 exit 1 ;; esac # switch to perl interpreter echo "$perlprog" @ 1.1 log @Initial revision @ text @@ 1.1.1.1 log @Import of shtool 1.0.0 @ text @@