fix bug for mac: readlink: illegal option -- f