Install the "realpath" utility and call it on your file in your script.
IIRC it's more or less Debian-specific. So if you use Debian:
apt-get install realpath
If not, get the sources from the debian site or compile your own quick & dirty one from this source:
Code:
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
char rpath[PATH_MAX];
if (argc != 2) {
printf("\n%s <path>\n", argv[0]);
exit(1);
}
if (realpath(argv[1], rpath) == NULL) {
fprintf(stderr, "Error resolving path.\n\n");
exit(2);
}
printf("%s\n", rpath);
return 0;
}