this supports arbitrary symlinking of the scripts and retrives the actual dirname where the files are laying.