Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Converting absolut symlinks to relative ones...?
- X-seq: zsh-users 21364
 
- From: Danek Duvall <duvall@xxxxxxxxxxxxxx>
 
- To: Meino.Cramer@xxxxxx
 
- Subject: Re: Converting absolut symlinks to relative ones...?
 
- Date: Sun, 6 Mar 2016 09:39:15 -0800
 
- Cc: zsh-users@xxxxxxx
 
- In-reply-to: <20160306132013.GA4938@solfire>
 
- List-help: <mailto:zsh-users-help@zsh.org>
 
- List-id: Zsh Users List <zsh-users.zsh.org>
 
- List-post: <mailto:zsh-users@zsh.org>
 
- Mail-followup-to: Danek Duvall <duvall@xxxxxxxxxxxxxx>, Meino.Cramer@xxxxxx,	zsh-users@xxxxxxx
 
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
 
- References: <20160306132013.GA4938@solfire>
 
On Sun, Mar 06, 2016 at 02:20:13PM +0100, Meino.Cramer@xxxxxx 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author