# Some handy shell-script utilities for the shell scripts that drive the
# 'devadm' command.

# Call with the $0 of the script as a parameter; this commands writes the
# name of the directory containing the script to standard output.
# Example:
#	conf_path $0

conf_path () {
	set `which $1 2>/dev/null` X
	if [ $# -ne 2 ]; then
		echo .		# Assume the current directory.
		return 1
	fi
	set `expr $1 : '\(.*\)/.*'` X
	if [ $# -ne 2 ]; then
		echo .		# Must be in the current directory.
	else
		echo $1
	fi
	return 0
}

