I need the relative path pointing to a certain directory. I have this:
/a/b/ef
/a/b/g/h/i/
Now I want to create a relative symbolic link from the second folder to the first one, so it should look like this: ../../../ef
How do I extract the relative path based on two absolute paths in Terminal?
I’m on Mac OS X.
I found a solution using Python and this recipe.
relpath.py
, stop at --- 8< --- snip --- 8< --- snip --- 8< --- snip --- 8< ---
cd
into the directorypython relpath.py install
in TerminalHere is my script, which uses the above module to create relative symlinks based on two directories: relsymlink.py Gist