File: th-sh

package info (click to toggle)
posh 0.14.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,108 kB
  • sloc: ansic: 14,639; xml: 1,604; perl: 964; sh: 110; makefile: 36
file content (27 lines) | stat: -rwxr-xr-x 453 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

#
# Simple script to find perl and run it
#

# Avoid common problems with ENV (though perl shouldn't let it through)
# (can you believe some shells don't have an unset???)
unset ENV

x=x
[ -x /bin/sh ] 2> /dev/null || x=f

IFS=:$IFS
perl=
for i in $PATH; do
    [ X"$i" = X ] && i=.
    [ -$x "$i/perl" ] && perl=$i/perl && break 2
done

[ X"$perl" = X ] && {
	echo "$0: can't find perl - bye\n" 1>&2
	exit 1
    }

unset IFS
exec $perl "$@"