#!/bin/sh
# $Id: isslink,v 1.5 1993/07/15 09:43:43 adl Exp $
#
# isslink
#
# Copyright (c) 1989-1993 Frame Technology Corp. All rights reserved.
# Return '0' if arg1 is a symbolic link, otherwise return '1'.  If arg1
# is '-l' (and arg2 is a symbolic link) then also print the source value
# of the link.

print=0

case $1 in
-l)
	print=1
	shift
	;;
esac

f=`/bin/ls -ld "$1" 2>/dev/null`

case "$f" in
[Ll]*)
	case $print in
	1)	echo "$f" | sed -e 's/.* //' ;;
	esac
	exit 0
	;;
esac
exit 1
