#!/bin/bash

# JeR@xs4all.nl 2005 presents:
#	readlink [OPTION]... FILE
# A simple readlink replacement for usage in/by portage.

# TODO: Implement the following options:
# -f, --canonicalize
#	Canonicalize  by  following  every symlink in every component of the
#	given path recursively
# -n, --no-newline
#	No trailing newline
# -q, --quiet,
# -s, --silent
#	Suppress most error messages
# -v, --verbose
#	Report error messages
# --help
#	Display this help and exit

# Very basic readlink replacement:
whatitlinksto="$(ls -ld ${1%%/} | sed 's/.*-> //g')"
echo ${whatitlinksto}

