coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: command for relative path


From: Bjartur Thorlacius
Subject: Re: command for relative path
Date: Sun, 13 Nov 2011 11:51:58 +0000

On 11/12/11, Peng Yu <address@hidden> wrote:
> On Sat, Nov 12, 2011 at 2:41 PM, Bjartur Thorlacius
> <address@hidden> wrote:
> I don't see how realpath can do what I want. relpath.py gives me the
> relative path of a from b. But realpath doesn't do so.
>
Sorry, my statement was completely false. Realpath -s is but a first
step to find relative pathnames between pathnames, whether absolute or
relative. Then the common prefix can be eliminated, if any. Finally
trailing pathname components of the base directory can be substituted
for .., and joined with the trailing pathname components of the
target.

> /tmp$ mkdir a b
> /tmp$ relpath.py a b
> ../a
>
IMO b should be the first, and preferably only, positional argument.
For the sake of iteration.

% relpath b a
../a



reply via email to

[Prev in Thread] Current Thread [Next in Thread]