checkSymbolicLink()
{
if [ ! -d $1 ]; then
return 1
fi
pushd $1 1>/dev/null
cdir=$(pwd)
while [ $cdir != '/' ]
do
if [ -h $cdir ]
then
return 0
fi
cd .. 1>/dev/null
cdir=$(pwd)
done
popd 1>/dev/null
return 1
}
To get real path, whether the path is real of symbolic, use realpath command.
No comments:
Post a Comment