#!/bin/sh
# $Id: isslink,v 1.4 1993/08/19 03:09:47 chip Exp $
#
# isslink
#  Copyright (c) 1989-1996 Adobe Systems, Incorporated. 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
