[BACK]Return to h_interpreter.sh CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / tests / kernel

File: [cvs.NetBSD.org] / src / tests / kernel / h_interpreter.sh (download)

Revision 1.1, Sun Dec 10 15:37:54 2017 UTC (2 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, netbsd-9-base, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, is-mlppp-base, is-mlppp, HEAD

Add tests to make sure that the program name is what it is supposed to be.

#!/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