if /local/bin/wsname 2>/dev/null; then # run wsname discarding its err msgs and check the exit code; if 0 then
base="`/local/bin/wsname`" # assign the output of wsname to the variable "base"
export base # and export that
fi
if [ -z "${base}" ]; then # if base is not set
/local/bin/wsname # run wsname again
exit 1 # and exit with error code
fi
WSNAME="$base"/ # assign base's content, extended by a "/" (making up a directory entry?), to the WSNAME variable
For more enlightenment we need to see more context...