Is it possible to get the directory a symlink'd file is located in. For example:
File A in directory X is a symlink of file B in directory Y. I want the path to directory Y while running scripts involving file A.
Edit: utilizing readlink doesn't work same way in MacOS as it does in other Unix projects. Would prefer to not need to install additional tools.
Based on chepner's comments was able to get this to work: