Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Converting absolut symlinks to relative ones...?



Hi,

following "problem":

At some point in a directory tree there is a file (the reference), 
which is physically copied multiple times into that
tree below that point at different nesting depths.

I want to create a script which will find those files
(already done) and replace those files with a symlink to the
reference file.

Since I dont know of a simple way to calculate the "difference"
of two absolute paths to create a relative path to the reference from the point of
view of its current copy, I came across the idea to create symlinks
with absolute paths to the reference in a first step and hope that there is a
zsh/system/linux utility which will create relative symlinks afterwards...

This idea has one drawback: I dont know of such an utility... ;)


Is there such an utility or is there even an utility which magically do that all
in one turn?

Thank you very much in advance for any help!
Best regards,
Meino






Messages sorted by: Reverse Date, Date, Thread, Author