Replaced 'readlink -f' with dirname,pwd,basename