zsh-users
 help / color / mirror / code / Atom feed
From: Danek Duvall <duvall@comfychair.org>
To: Meino.Cramer@gmx.de
Cc: zsh-users@zsh.org
Subject: Re: Converting absolut symlinks to relative ones...?
Date: Sun, 6 Mar 2016 09:39:15 -0800	[thread overview]
Message-ID: <20160306173915.GC10755@lorien.comfychair.org> (raw)
In-Reply-To: <20160306132013.GA4938@solfire>

On Sun, Mar 06, 2016 at 02:20:13PM +0100, Meino.Cramer@gmx.de wrote:

> 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... ;)

GNU ln has a -r option which does this.

Danek


  reply	other threads:[~2016-03-06 17:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-06 13:20 Meino.Cramer
2016-03-06 17:39 ` Danek Duvall [this message]
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=20160306173915.GC10755@lorien.comfychair.org \
    --to=duvall@comfychair.org \
    --cc=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).