title: MacOS get directory symlink'd file is located in
body: <p>Is it possible to get the directory a symlink'd file is located in.  For example: </p>
  
  <p>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.</p>
  
  <p>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.</p>