O script está longe de estar pronto, mas você está no caminho certo agora.
if [ "$#" -ne 1 ]; then
echo 1>&2 "$0: please insert one valid file name;found $# ($*) "
echo 1>&2 "Usage: $0 [Filename..]"
exit 2
fi
if [ -z "$1" ] ; then
echo 1>&2 "$0: file name cannot be empty; found $# ($*) "
echo 1>&2 "Usage: $0 [filename...] "
exit 2
fi
if [ ! -L "$1" ] ; then
echo 1>&2 "$0: The pathname '$1' is not a symlink"
echo 1>&2 "Usage: '$0' [symlink] "
exit 2
fi
a=$(ls -l "$1" | awk '{ print $NF }')
if [ -z "$a" ] ; then
echo 1>&2 "$0: A Really Good Error Message."
exit 3
fi
# type=$a
case "$a" in
/*) type='an Absolute Pathname' ;;
*) type='a Relative Pathname in the current directory' ;; # the "default" match
esac
echo "pathname'$a' is $type"