#!/bin/sh

case "$1" in
	(*.*)
		f="$(find / -type f -name "$(echo "$1.ucxs" | awk '{sub(/\./,"_");print}')")"
		[ -f "$f" ] && echo "$f"
		;;
	(*)
		while read -r dir
		do
			find "$dir" -type f -name "$1.ucx" && break
		done <<PATH
$(echo "$UCX_PATH" | awk '{gsub(/:/,ORS);print}')
PATH
esac
