OK, so I know this is absolutely horrid and I'm sure it can be much much
better.
but this was some ancient glue about 100 years old of mine.
hope it helps.

relative directories going down a level, then up again will show a
little odd, but still work.

its pure bash mind :\

On Wed, 2005-01-12 at 03:11 -0800, Jeremy Huddleston wrote:
> Ok, I'm sure someone has some code for this lying around, so I really
> don't want to reinvent the wheel when I've got so much else to do...
> so...
> 
> Does anyone know a way to find the relative path between two absolute
> paths... for instance, I want something which behaves like:
> 
> # find_relative_path /usr/include/asm-sparc /usr/include/asm
> ../asm-sparc
> 
> If it's a bash function, that would be great, but relying on things in
> 'emerge system' would be alright.
> 
> Thanks.
-- 
Role:            Gentoo Linux Kernel Lead
Gentoo Linux:    http://www.gentoo.org
Public Key:      gpg --recv-keys 9C745515     
Key fingerprint: A0AF F3C8 D699 A05A EC5C  24F7 95AA 241D 9C74 5515
Web:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x9C745515

Attachment: relativepath
Description: application/shellscript

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to