host_information.sh 507 Bytes
##
# start guessing the system type via uname and export it.
#
gather_host_info() {
	[ -z "${OS}" ] || return

	OS="$(${UNAME} -o)"
	KERNEL="$(${UNAME} -s)"
	VERSION="$(${UNAME} -r)"
	PLATFORM="$(${UNAME} -m)"
	HOSTNAME="$(${UNAME} -n)"
	GNU="$([ "${OS%GNU*}" != ${OS} ] && echo "GNU")"
	CLASSES="${OS}\n${GNU}\n${KERNEL}\n${VERSION}\n${PLATFORM}\n${HOSTNAME}"
	CLASSES="$(${ECHO} -e "${CLASSES}" | ${SORT} -u | ${TR} "\n" " ")"

	export OS KERNEL VERSION PLATFORM HOSTNAME CLASSES
}

# vim: set ts=4 sw=4: