summaryrefslogtreecommitdiff
path: root/tests/kernel/h_interpreter.sh
blob: 51567593fae3551e5357755f5c6adbfd1018f50e (plain)
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

cmd=$1
shift
case "${cmd}" in
interpreter)
	"${1}" $$
	;;
dot)
	cp "${1}" .
	z="./$(basename "${1}")"
	x=$(${z} -1)
	case ${x} in
	/*)	x=$(readlink "${x}");;
	*)	echo "non absolute path" 1>&2; exit 1;;
	esac

	e=$(readlink "$(/bin/pwd)/${z}")
	if [ "${x}" != "${e}" ]; then
		echo bad: ${x} != ${e} 1>&2
		exit 1
	fi
	;;
*)
	echo bad command ${cmd}
esac