BASH: Convert absolute path into relative path given a current directory

Posted by Paul Tarjan on Stack Overflow See other posts from Stack Overflow or by Paul Tarjan
Published on 2010-04-02T01:42:38Z Indexed on 2010/04/02 1:43 UTC
Read the original article Hit count: 872

Filed under:
|
|
|
|
absolute="/foo/bar"
current="/foo/baz/foo"

# magic

relative="../../bar"

Can you help me with magic? (Hopefully not too complicated code...)

© Stack Overflow or respective owner

Related posts about bash

Related posts about shell