zsh-users
 help / color / mirror / code / Atom feed
From: Meino.Cramer@gmx.de
To: zsh-users@zsh.org
Subject: Converting absolut symlinks to relative ones...?
Date: Sun, 6 Mar 2016 14:20:13 +0100	[thread overview]
Message-ID: <20160306132013.GA4938@solfire> (raw)

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





             reply	other threads:[~2016-03-06 13:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-06 13:20 Meino.Cramer [this message]
2016-03-06 17:39 ` Danek Duvall
2016-03-06 19:38   ` Bart Schaefer
2016-03-06 20:21     ` Danek Duvall
2016-03-06 21:22       ` Vin Shelton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160306132013.GA4938@solfire \
    --to=meino.cramer@gmx.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).